stable code that works without MyThreadExit in the end