writes file successfully, newline character doesn't work for PrintWriter