Fix for checking date