fixed thread_destroy