loop starts over before finishing

Hi, im kinda new to this. I got 3x stepper motors (28byj-48) with a arduino uno r3 and this code:

#include <Stepper.h>
int stepsInRev = 350;
Stepper motorbottom(stepsInRev, 13, 11, 12, 10);
Stepper motormid(stepsInRev, 9, 7, 8, 6);
Stepper motortop(stepsInRev, 5, 3, 4, 2);

void setup() {
  motortop.setSpeed(70);
  motormid.setSpeed(70);
  motorbottom.setSpeed(70);
}

void loop() {
motorbottom.step(200);
motormid.step(-250);
motortop.step(-600);

delay(1000);
motortop.step(600);
motormid.step(250);
motorbottom.step(200); 
delay(1000);
}

The problem i got is that it runs one time fully and the second time it restarts at the motormid.step(250); or even before that. When i just control 2 motors like the code below, it works fine.

#include <Stepper.h>
int stepsInRev = 350;
Stepper motorbottom(stepsInRev, 13, 11, 12, 10);
Stepper motormid(stepsInRev, 9, 7, 8, 6);
Stepper motortop(stepsInRev, 5, 3, 4, 2);

void setup() {
  motortop.setSpeed(70);
  motormid.setSpeed(70);
  motorbottom.setSpeed(70);
}

void loop() {
motormid.step(-250);
motortop.step(-600);
delay(1000);
motortop.step(600);
motormid.step(250);
delay(1000);
}

Does anyone know why it does not keep completing the loop?

It's powered by a 9v battery but a broken cable was the problem, it restarted the Arduino when it turned....