Bug fix : prevent sending messages when not connected