change validate rules when field is optional