use index on value loop