fix "thread not exit" error