fix id generator bug