adds exit status to output file