modify thread shutdown