Fix the update query tool to work properly