fixed misreference to indices