added validation and test