A comment about this issue - variables are saved by wait, but they are not in the same memory location - can be found in the wait documentation.