before changing id to index