Wait for close instead of exit on spawn