fix a bug in thread (std::thread::detach() should be called)