Fixed one potential crash (index out of range)