fix indexing err