shutdown bug fix

only one thread shutdown