reversing the query