You are indexing past the end of the array.