write index to output directory