fixing indexing