Fixed a Bug that occurs when a large number of threads