fix bug in validator.