add `validator` rule for customized function