fixed some problems with index