bugfix on index search