Add a proper id to each sub-index