fix correct indexing