too many indices for array: array is 1-dimensional, but 2 were indexed