added validation on the integer input.