correct \n formating in output file