fix thread id issue