fix indexing for array field