The two loops look the same but have different purposes, I first check that 'Neutron' is running, and then that it's completed.
Me no understand why you need do that especially if you're the author of all the programs involved. Would it not be simpler to have the one that's closing launch the next one in the chain in its closing events?