debug index out of range, at ToJ[]