fixed bug for send message when as a client