     }
     
     private func flushStore(completion: @escaping EventTrackerCompletion) {
-        self.store.allEvents { (events, error) in
+        self.store.allEvents { [weak self] (events, error) in
             if let err = error {
                 completion(err)
             } else {
-                self.flusher.flushEvents(events: events, completion: { (error) in
+                self?.flusher.flushEvents(events: events, completion: { [weak self] (error) in
                     if let err = error {
                         completion(err)
                     } else {
-                        self.clearStore(completion: completion)
+                        self?.clearStore(completion: completion)
                     }
                 })
             }

        }
        
        override func execute() {
            self.tracker?.preTrackActions { (error) in
                if let err = error {
                    if let c = self.completion {
                        c(err)
                    }
                    self.finish()
                } else {
                    self.tracker?.store.storeEvent(event: self.event, completion: { (error) in
                        if let c = self.completion {
                            c(error)
                        }
                        self.finish()
                    })
                }
            }
        }

    }
    
    private func flushStoreIfNecessary(limit: Int, completion: @escaping EventTrackerCompletion) {
        self.store.allEvents { [weak self] (events, error) in
            if let err = error {
                completion(err)
            } else if events.count >= limit {
                self?.flushStore { (error) in
                    completion(error)
                }
            } else {
