update query to string