I see the confusion. Not everything is reset on a Restart. I think I've caught them all. Typically you set things up in 'Onstart of layout', rather than at the end.
Note: Wait does not block. It looks like you expect Wait to block, so I tweeked a few things. Read up on Wait in the manual for details.