use cached value instead of arr index