fixed index name and file output name