 			break;
 
 		case IN_CMD:
-			if (!(input = userInput("CMD: ")))
+			if (!(input = userInput("CMD: "))) {
+				newState = IN_CMD;
 				break;
+			}
 			if (!strcmp(input,"SERVO"))
 				newState = IN_SERVO;
 			else if (!strcmp(input,"STEPPER"))


		case IN_SERVO:
			if (!(input = userInput("ANGLE: ")))
				break;
			value = atoi(input);
			servoCommand(value);
			newState = IN_CMD;


		case IN_STEPPER:
			if (!(input = userInput("STEPS: ")))
				while (!(input = userInput(NULL)));
			value = atoi(input);
			stepperCommand(value);
			newState = IN_CMD;
