validate method in input class
validate