          */
         tickItemButton.rx.tap
             .subscribe(onNext: {[unowned self] value in
-                try! self.realm.write {
+                try! realm.write {
                     self.ticker.ticks += 1
                 }
             })

    }()

    lazy var ticker: TickCounter = {
        let ticker = TickCounter()
        try! self.realm.write {
            self.realm.add(ticker)
        }
        return ticker
    }()

//view controller
class ViewController: UIViewController {
    let bag = DisposeBag()

    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var tickItemButton: UIBarButtonItem!
    @IBOutlet weak var addTwoItemsButton: UIBarButtonItem!
