fixed the validator to work