added validation of values