Fix for sort by date

This fix sucks