bug fixed : thread number may be not continuous