     // MARK: Actions
 
     @objc private func deactiveSearchController(sender: NSNotification) {
-        searchController?.active = false
+        if let searchController = searchController {
+            searchController.active = false
+        }
     }
 
     private func updateContactsTableView() {

    #endif

    private var searchController: UISearchController?
    var searchControllerIsActive: Bool {
        return searchController?.active ?? false
    }


            self.searchController = searchController

            // ref http://stackoverflow.com/questions/30937275/uisearchcontroller-doesnt-hide-view-when-pushed
            //self.definesPresentationContext = true
        }

        contactsTableView.separatorColor = UIColor.yepCellSeparatorColor()
