Is there a reason you didn't put the shortcut exit in wait()?