fixes indexing issue