updated validator class

fixed bugs