                 self.subscriberType[request.rootKeyPath] = R.SerializedObject.self
                 self.subscribers[request.rootKeyPath] = completion
                 self.subscriptions[request.rootKeyPath] = message
-                self.webSocket.write(string: message, completion: nil)
+                self.webSocket?.write(string: message, completion: nil)
             }
         }
         catch let error {


open class WebSocketClient {
    let queue: DispatchQueue
    let webSocket: WebSocket
    public var delegate: WebSocketClientDelegate?
    private var subscribers = [String: WebSocketCompletionBlock]()
    private var subscriberType = [String: Decodable.Type]()

    }
    
    public func disconnect() {
        self.webSocket?.disconnect()
        self.subscriptions.removeAll()
        self.subscribers.removeAll()
    }
