added validation method