Event Handler VisionWindowsClosed Not executing Script Correctly

I have the following simple code on VisionWindowsClosed

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.

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

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