fixing index glitch