         }
         
         let auth = self.pubKey + "|" + self.subKey;
-        
-        RestApiManager.sharedInstance.makeHTTPDeleteRequestText(baseURL, parameters: params, user: auth, password: self.secretKey) { text, err in
+        let host = self.host
+        let secretKey = self.secretKey
+        RestApiManager.sharedInstance.makeHTTPDeleteRequestText(baseURL, parameters: params, user: auth, password: secretKey) { text, err in
             if (callback != nil && err == nil) {
                 
-                let baseURL = "https://" + self.host + "/api/magistral/net/user_permissions"
-                
-                RestApiManager.sharedInstance.makeHTTPGetRequest(path: baseURL, parameters: [ "userName" : user], user: auth, password : self.secretKey, onCompletion: { json, err in
+                let baseURL = "https://" + host + "/api/magistral/net/user_permissions"
+                
+                RestApiManager.sharedInstance.makeHTTPGetRequest(path: baseURL, parameters: [ "userName" : user], user: auth, password : secretKey, onCompletion: { json, err in
                     do {
                         let permissions : [io.magistral.client.perm.PermMeta] = try JsonConverter.sharedInstance.handle(json: json);
                         callback?(permissions, err == nil ? nil : MagistralException.permissionFetchError);

        
        if (cipher != "") { self.cipher = cipher; }
        
        self.connectionPoints(callback: { token, settings in
            self.settings = settings;
            
            self.initMqtt(token: token, connected: { status, magistral in
                connected!(status, magistral);
            })
        });

                        for _ch in meta.channels() {
                            xx.append(_ch)
                        }
                        self.read(topic, group: group, channels: xx, listener: listener, callback: { [weak self] in
                            self?.mqtt?.subscribe(topic, channel: ch, group: group, qos: .atLeastOnce, callback : { meta, err in
                                callback?(meta, err)
                            })
                        });
