fixing a bug with indexing