Fix to date sorting