I am running a step motor with arduino, but the stepper motor switches direction under any sort of torque applied to the shaft

I am running a step motor with arduino, but the stepper motor switches direction under any sort of torque applied to the shaft:

#arduino