now getting the query