fix problem with index