Fixed a bug where send message in client wasn't blocking