Changed the query order