added ordering by date into the query