try to write output to file