Date comparison problem fixed