fixed bug when index was not completely rebuilt