change some thread logic