         
         if (cipher != "") { self.cipher = cipher; }
         
-        self.connectionPoints(callback: { token, settings in
-            self.settings = settings;
-            
-            self.initMqtt(token: token, connected: { status, magistral in
+        self.connectionPoints(callback: { [weak self] 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: {
                            self.mqtt?.subscribe(topic, channel: ch, group: group, qos: .atLeastOnce, callback : { meta, err in
                                callback?(meta, err)
                            })
                        });

            "channel": channels
        ]
        
        RestApiManager.sharedInstance.makeHTTPGetRequest(path: baseURL, parameters: params, user: user, password : self.secretKey, onCompletion: { [weak self] json, err in
            do {
                
                let messages = try JsonConverter.sharedInstance.handleMessageEvent(json: json);
                
                for m in messages {
                    
                    if let chixs = self?.init_indexes[m.topic()] {
                        if let ixs = chixs[m.channel()] {
                            if m.index() > ixs {
                                listener(m, nil)
                                self?.init_indexes[m.topic()]?[m.channel()] = m.index()
                            }
                        } else {
                            listener(m, nil)
                            self?.init_indexes[m.topic()]?[m.channel()] = m.index()                                }
                    } else {
                        listener(m, nil)
                        self?.init_indexes[m.topic()] = [ : ]
                        self?.init_indexes[m.topic()]?[m.channel()] = m.index()
                    }
                }
                callback();
