Sorts by date correctly