updated loading of index. Now appropriate indices are loaded during nextDoc