Revise the bug of setting the thread number.