DW new motor wont cycle long enough

I just replaced the motor, it had a broken shaft. Now it works but wont stay in drain or wash cycle long enough. Only about 15 seconds then shuts off.
Any ideas?