added a validator for dates