using subs in validations