Fixed the thread number issue