Fixed error where stop index wasn't added correctly