fixed newlines for file mode