Fixed some bugs sending message