         Serial.print(var);
         Serial.write('\n');
     } else {
-        Serial.write("err not configured\n");
+        errConf();
     }
+}
+
+void errConf() {
+     Serial.write("err not configured\n");
 }
 
 void succes() {

                    motorZ.rotateSteps(-posZ);
                    succes();
                } else {
                    Serial.write("err not configured\n");
                }
            case '!': // set config
                while (!Serial.available());

    while(!Serial);
}

void setPos(int & pos, Motor & motor) {
    if (!configured) {
        errConf();
        return();
    }
    int to = Serial.parseInt();
    motor.rotateSteps(to - pos);
    pos = to;
    succes();
}

void cmdMotor(int & pos, Motor & motor) {
    int steps = Serial.parseInt();
    pos += steps;
