                 "Number of Tags",
                 rows: 200,
                 initialSelection: self.numberOfTags-1,
-                doneBlock: { (_, selectedValue) in
-                    self.numberOfTags = selectedValue
-                    self.fetchData() },
+                doneBlock: { [weak self] (_, selectedValue) in
+                    self?.numberOfTags = selectedValue
+                    self?.fetchData()
+                },
                 cancelBlock: nil
             )
         }))

            success: { [weak self] tags in
                guard let strongSelf = self else { return }
                strongSelf.refreshControl.endRefreshing()
                
                strongSelf.persistenceCentral.deleteTags(in: strongSelf.category!)
                let manager = strongSelf.persistenceCentral.coreDataStackManager
                
                let mappedTags = FlickrTag.map(on: tags,
                                               with: strongSelf.category!,
                                               in: manager.managedObjectContext)
                manager.saveContext()
                strongSelf.tags = mappedTags
                
                strongSelf.setUIState(.successDoneWithDownloading)
        }) { [weak self] error in
            self?.refreshControl.endRefreshing()

            self?.present(alert!, animated: true, completion: nil)
        }
    }

}

// MARK: - FlickrHotTagsViewController (Private Helpers) -

extension FlickrHotTagsViewController {

    private func setup() {
        configureUI()

        if tags.count == 0 {
            fetchData()
        }
    }

    private func configureUI() {
        refreshControl.addTarget(self, action: #selector(fetchData), for: .valueChanged)
        tableView.addSubview(refreshControl)
        
