fix lockup on exit