Fixing date sort feature