fix '\n' issue on windows OS

Windows writes newline as: '\r''\n'
Linux writes newline as: '\n'.