added key field to output files