save to output file