change the way output is print to a file