add index to each record