in reply to Looping Window

Let me suggest that you try to reduce the question to some minimal amount of (portable) code, such that you can post two complete, runnable scripts: some simple thing that takes the place of your "menu program", and some other simple thing that can be run by itself, and also be invoked from the menu program.

If this minimal pair of scripts will demonstrate the same weirdness, we'll have a better chance to see why. If it doesn't, it becomes a question of figuring out what part of the removed code is causing the problem...