if not repeating then stops at the end