Z-Axis Motor Wiring

So I get this error the z axis moves once and then it all stops.

and If I wire the motor just like the x and y motors it just sits and runs non stop