move id calc out of for loop for zk registration