BUGFIX: do not send messages through websocket if websocket is not connected