Corrected bug for motor direction