Fixed null pointer exception while loading indexes