Fix index loading bug