better shutdown when run inprocess