make date validation work