Correct output to file