   	}
   	digitalWrite(pinDirX, directX); // dirX
   		
-  	if(x > (setpointX + hysteresis) || (x < setpointX - hysteresis ))
+  	if(x > (setpointX + hysteresis) || (x < setpointX - hysteresis || !xok ))
   	{
   	    digitalWrite(pinStepX, 1);
             delayMicroseconds( 500 );

  	}
  	digitalWrite(pinDirY, directY); // dirX
  		
  	if(y > (setpointY + hysteresis) || (y < setpointY - hysteresis ))
  	{
  	    digitalWrite(pinStepY, 1);
            delayMicroseconds( 500 );

  	}
  		
  	// SET Z IN POSITION
  	if(!digitalRead(Z_POSITION))
  	{
  	    digitalWrite(pinStepZ, 1);
            delayMicroseconds( 500 );
