Fixed bug on unload of index