Check for invalid date is working