Please post the full text of the error message that shows where the error happens.
The error says that there is an index past the end of the array.
Remember that the indexes for an array range...