fix stepper motor control bugs