     int steps = Serial.parseInt();
     pos += steps;
     motor.rotateSteps(steps);
-    Serial.write("OK.\n");
+    succes();
 }
 
 void writePos(char name, int var) {
-    Serial.write("set pos.");
-    Serial.write(name);
-    Serial.write(' ');
-    Serial.print(var);
-    Serial.write('\n');
+    if (configured) {
+        Serial.write("set pos.");
+        Serial.write(name);
+        Serial.write(' ');
+        Serial.print(var);
+        Serial.write('\n');
+    } else {
+        Serial.write("err not configured\n");
+    }
+}
+
+void succes() {
+    Serial.write("ok.\n");
 }
 
 void loop() {

    if (Serial.available()) {
        char axis = Serial.read();
        switch (axis) {
            case 'r': // reset
                if (configured) {
                    motorX.rotateSteps(-posX);
                    motorY.rotateSteps(posY);
                    motorZ.rotateSteps(-posZ);
                    Serial.write("ok. done\n");
                } else {
                    Serial.write("err not configured\n");
                }
            case 'c': // config
                while (!Serial.available());
                switch (arg = Serial.read()) {
                    case '0': // set reference point
                        configured = true;
                        posX = posY = posZ = 0;
                        Serial.write("OK.\n");
                        break;
                    case '!': // unset reference point
                        configured = false;

                        writePos(arg, posZ);
                        break;
                    default:
                        Serial.write("err unknown status ");
                        Serial.write(arg);
                        Serial.write('\n');
                }
                break;
            case 'p': // ping
