fix bug: self.connect is set before websocket state is connected, so disconnect() threw an error if called while the websocket connection is still being established