Adjusting the query