Adjust order to write index file.