implemented the validator