fix the bug that there is an unexpected "\n" after message