fix id assigning problem.