debug index out of bounds