# Routine goes away from Flow when PsychoPy restarted

**URL:** <https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747>\
**Category:** Builder\
**Created:** [June 26, 2018, 11:32pm UTC](https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747 "2018-06-26T23:32:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahirju30](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jahirju30](https://discourse.psychopy.org/u/jahirju30)\
**Post date:** [June 26, 2018, 11:32pm UTC](https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747/1 "2018-06-26T23:32:57Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10): Windows 10  
**PsychoPy version** (e.g. 1.84.x): 1.90.2  
**Standard Standalone? (y/n)** Yes

I added a new instruction Routine in the Flow, but the routine goes away from the Flow when PsychoPy is closed and run again. The Routine still is available in the builder window, but PsychoPy asks to add it again to the Flow.

The following message appears in the black Python.exe window.

“4.2010 ERROR A Routine called ‘b\_instr\_2\_’ was on the Flow but could not be found (failed rename?). You may need to re-insert it”

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [June 27, 2018, 2:49am UTC](https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747/2 "2018-06-27T02:49:04Z")

</div>

What is your routine named?

---

<div class="post-metadata">

**Author:** ![jahirju30](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jahirju30](https://discourse.psychopy.org/u/jahirju30)\
**Post date:** [June 27, 2018, 3:06am UTC](https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747/3 "2018-06-27T03:06:36Z")

</div>

I probably named it “instr\_2” at the beginning, but it got renamed as [b\_‘instr\_2’], exactly as between the bracket with the single quotes, when PsychoPy restarted. Tried renaming it, doesn’t work!

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [June 27, 2018, 7:02am UTC](https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747/4 "2018-06-27T07:02:55Z")

</div>

OK, it sounds like your .psyexp file has become corrupted. Never fear, it is just a plain text file structured as XML. So you can _ **make a copy** _ of the file and open it in a text editor (ideally one that will color code XML syntax). You can then search through and find the entry for the mis-named routine in the flow section and delete it. Save, and see if Builder can make sense of the edited file. Rinse and repeat if required to get it to work. _NB the bit about only editing a copy: it’s easy for this sort of manual editing to go wrong._

Although first you might want to try reading the error message more closely, and rename the routine to have a trailing underscore.

---

<div class="post-metadata">

**Author:** ![jahirju30](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jahirju30](https://discourse.psychopy.org/u/jahirju30)\
**Post date:** [June 27, 2018, 1:44pm UTC](https://discourse.psychopy.org/t/routine-goes-away-from-flow-when-psychopy-restarted/4747/5 "2018-06-27T13:44:17Z")

</div>

This indeed solved my problem! I found that the concerned Routine was named there, but with no details at all (just one file)! Deleted it and it’s all good now. Thanks a lot for your super quick responses, Michael!
