throwQuery method