finish the index file