fix if statement in motor control.