fix the issue that outbound message is not really wrote out