             print("Transport websocket write failed: ERROR IS NIL!")
         }else{
             print("Transport websocket write failed: \(error!.localizedDescription)")
-            self.delegate?.fayeClientError?(error!)
+            self.delegate?.fayeClientError(error!)
         }
     }
     

                
                if let subscription = messageJSON[0]["subscription"].string{
                    self.openSubscriptions.removeObject(subscription)
                    self.delegate?.didUnsubscribeFromChannel?(subscription)
                }else{
                    print("Missing subscription for Unsubscribe")
                }

    
    func didDisconnect() {
        print("Transport websocket lost connection!")
        self.delegate?.disconnectedFromServer()
        self.connectionInitiated = false
        self.fayeConnected = false
    }
    
    func didFailConenction(error: NSError?) {
        print("Transport websocket is disconnected: \(error!.localizedDescription)")
        self.delegate?.connectionFailed()
        self.connectionInitiated = false
        self.fayeConnected = false
    }
