- fix an invalid index exception