Fixed corrupt index file issue