change some id getting function to be a syn function to make the function safe in different thread