fixed newline issue on output