# Loop only running 1x instead of 8x before ending routine

**URL:** <https://discourse.psychopy.org/t/loop-only-running-1x-instead-of-8x-before-ending-routine/13006>\
**Category:** Builder\
**Tags:** randomization\
**Created:** [May 4, 2020, 11:38pm UTC](https://discourse.psychopy.org/t/loop-only-running-1x-instead-of-8x-before-ending-routine/13006 "2020-05-04T23:38:08Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![LukasPsy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/lukaspsy/32/4582_2.png) [@LukasPsy](https://discourse.psychopy.org/u/LukasPsy)\
**Post date:** [May 6, 2020, 6:20am UTC](https://discourse.psychopy.org/t/loop-only-running-1x-instead-of-8x-before-ending-routine/13006/4 "2020-05-06T06:20:13Z")

</div>

Could you [surround your code with backticks to keep the formatting intact?](https://discourse.psychopy.org/t/please-surround-python-code-with-backticks/1775)

> [@sgwallner](#):
>
> I also tried to set continueRoutine = True in End Routine

That wouldn’t have an effect because `continueRoutine` ends the routine and if you’re already at the end of the routine, you don’t need to end it 😉

It is difficult to say from the information we have, but could it be, that the loops run through super fast?

```auto
if (target_L.contains(mouse.getPos()) or target_R.contains(mouse.getPos())):
    reach_target = True
if reach_target == True:
   continueRoutine = False

```

With this code, you’re not requiring a click; you’re just checking the position of the mouse. If the mouse hovers over the image position, the next trial might show so fast, that you wouldn’t notice, because it instantly fulfils the condition `if (target_L.contains(mouse.getPos()) or target_R.contains(mouse.getPos()))`

Could you make a screenshot of how you organize your loop? The logging file shows that you set your loop to 5 repetitions of your 8 images (= 40 trials). I think what you want is one repetition (= 8 trials).

Could you upload your entire conditions file and the logging file?

---

_[View the full topic](https://discourse.psychopy.org/t/loop-only-running-1x-instead-of-8x-before-ending-routine/13006)._
