# Bug: Flow of robot program returns to the start

**URL:** <https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653>\
**Category:** Technical Questions\
**Tags:** bugs\
**Created:** [September 3, 2020, 3:29am UTC](https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653 "2020-09-03T03:29:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fujikit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/fujikit/32/6042_2.png) [@fujikit](https://forum.universal-robots.com/u/fujikit)\
**Post date:** [September 3, 2020, 3:29am UTC](https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653/1 "2020-09-03T03:29:37Z")

</div>

Hi.

I found a bug of robot program.  
Flow of robot program returns to the start when “return” statement is insufficient due to the conditional branch in the ur script.

Robot type: UR3  
Controller version: SW3.12.1

 ![return1](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/3/3b1beb593dc2d80d32b1e8ee1026a78492544396.png)

 ![return2](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/5/5279d25dff4bb6034b0b4165c8534c0627f5fad3.png)

---

<div class="post-metadata">

**Author:** ![mbush](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mbush/32/76_2.png) [@mbush](https://forum.universal-robots.com/u/mbush)\
**Post date:** [September 3, 2020, 11:42pm UTC](https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653/2 "2020-09-03T23:42:31Z")

</div>

We have seen the same issue in both 3.X and 5.X versions of the software

---

<div class="post-metadata">

**Author:** ![anon36990825](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anon36990825](https://forum.universal-robots.com/u/anon36990825)\
**Post date:** [October 21, 2020, 12:01pm UTC](https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653/3 "2020-10-21T12:01:28Z")

</div>

We are also experiencing this

Temporary work around for us was to put a statement in between the final end statements. We use sync() or sleep(0).

e.g.

def myscript(a):  
if (a ==1):  
return True  
end  
sync()  
end

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [October 21, 2020, 12:57pm UTC](https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653/4 "2020-10-21T12:57:14Z")

</div>

The behavior is confirm and reported. Thanks!

---

<div class="post-metadata">

**Author:** ![fujikit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/fujikit/32/6042_2.png) [@fujikit](https://forum.universal-robots.com/u/fujikit)\
**Post date:** [October 22, 2020, 10:10am UTC](https://forum.universal-robots.com/t/bug-flow-of-robot-program-returns-to-the-start/8653/5 "2020-10-22T10:10:27Z")

</div>

Hi @Ebbe

Thank you for your confirmation.  
I look forward to the next update.
