      - parameter dataReceived: callback to receive the websocket data
      */
     public func openStream(vehicle: Vehicle, dataReceived: @escaping (StreamEvent) -> Void) {
-        guard let urlRequest: URLRequest = getStreamURLRequest(vehicle: vehicle) else {
-            return
-        }
-        webSocket = WebSocket(request: urlRequest)
-        webSocket?.open()
-        webSocket?.event.message = { data in
-            if let string = data as? String,
-                let mapped: StreamEvent = Mapper<StreamEvent>().map(JSONString: string) {
-                    dataReceived(mapped)
+        if let urlRequest: URLRequest = getStreamURLRequest(vehicle: vehicle) {
+            webSocket = WebSocket(request: urlRequest)
+            print("Open Websocket")
+            webSocket?.open()
+            webSocket?.event.message = { data in
+                print("data: \(data)")
+                if let string = data as? String,
+                    let mapped: StreamEvent = Mapper<StreamEvent>().map(JSONString: string) {
+                        dataReceived(mapped)
+                }
             }
         }
     }

	
	open var token: AuthToken?
	
	fileprivate var email: String?
	fileprivate var password: String?
    fileprivate var webSocket: WebSocket?
	

	public func authenticate(email: String, password: String) -> Promise<AuthToken> {
		
		self.email = email
        UserDefaults.standard.set(email, forKey: "TeslaSwift.email")
		self.password = password

		let body = AuthTokenRequest(email: email,
