Fixed the array subscript error.