write output to a tmp file for possible debugging