                         }
                     }
                     
-                    var t:AnyObject? = messagesBuffer?.object(forKey: messageId) as AnyObject!
                     if messagesBuffer?.object(forKey: messageId) != nil &&
                         ((messagesBuffer?.object(forKey: messageId) as! NSDictionary).object(forKey: "isMsgSent") as! Bool) == true {
                         messagesBuffer?.removeObject(forKey: messageId)

                    content = "privatekey=\(privateKey)"
                }
                
                connectionUrl = connectionUrl + path
                let postData: Data = (content as NSString).data(using: String.Encoding.utf8.rawValue, allowLossyConversion: true)!
                let postLength: String = "\(CUnsignedLong((postData as Data).count))"
                let request: NSMutableURLRequest = NSMutableURLRequest()
                request.url = URL(string: connectionUrl)
                request.httpMethod = "POST"
                request.setValue(postLength, forHTTPHeaderField: "Content-Length")
                request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")

    func generateError(_ errText: String) -> NSError {
        let errorDetail: NSMutableDictionary = NSMutableDictionary()
        errorDetail.setValue(errText, forKey: NSLocalizedDescriptionKey)
        return NSError(domain: "OrtcClient", code: 1, userInfo: ((errorDetail as NSDictionary) as! [AnyHashable: Any]))
    }
    
    func doConnect(_ sender: AnyObject) {
