change some code for trans thread