sorting by date fix