avoid accidental hangs when exiting