working on thread_destroy