debug index out of range