custom validator to remove activemodel dependency