Add more checks for invalid dates