add index on for loop