# Event Handler VisionWindowsClosed Not executing Script Correctly

**URL:** <https://forum.inductiveautomation.com/t/event-handler-visionwindowsclosed-not-executing-script-correctly/24123>\
**Category:** Ignition\
**Created:** [April 14, 2019, 4:32am UTC](https://forum.inductiveautomation.com/t/event-handler-visionwindowsclosed-not-executing-script-correctly/24123 "2019-04-14T04:32:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juang](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@juang](https://forum.inductiveautomation.com/u/juang)\
**Post date:** [April 14, 2019, 4:32am UTC](https://forum.inductiveautomation.com/t/event-handler-visionwindowsclosed-not-executing-script-correctly/24123/1 "2019-04-14T04:32:39Z")

</div>

I have the following simple code on VisionWindowsClosed

```auto
system.nav.closeWindow('Orders/Opensalesorders')
system.nav.closeWindow('CalendarEvents/OCalendarMonth')

```

problem is that it only closes the second window in the script the other one stays open.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 15, 2019, 3:36pm UTC](https://forum.inductiveautomation.com/t/event-handler-visionwindowsclosed-not-executing-script-correctly/24123/2 "2019-04-15T15:36:12Z")

</div>

Are you sure that’s _exactly_ what the window name and path are? Try `print system.gui.getOpenedWindowNames` before the `closeWindow` calls.

---

<div class="post-metadata">

**Author:** ![juang](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@juang](https://forum.inductiveautomation.com/u/juang)\
**Post date:** [April 15, 2019, 4:09pm UTC](https://forum.inductiveautomation.com/t/event-handler-visionwindowsclosed-not-executing-script-correctly/24123/3 "2019-04-15T16:09:22Z")

</div>

Yes I’m sure. And it actually works perfectly on the internal frame being close it closes both windows. It only does not work on the VisionWindowsClosed. I’m now sure why . But I tried the same two line script and it works actually also on frameOpened. Closing , close , but not windows closed. Did you tried and it worked ? If you let me know. Thank you for the help
