change some code's order