add sort to the query to fix the date