adding a date validation check