fix a bug that newline character is eliminated