Added query to order by date