     
     func exitClick(sender: AnyObject?) {
         NSLog("exitClick")
+        
+        let alert = NSAlert()
+        
+        alert.addButton(withTitle: "Turn off")
+        alert.addButton(withTitle: "Cancel")
+        alert.messageText = "Turn off Blockstack?"
+        alert.informativeText = "You will not be able to access the decentralized internet if you turn off Blockstack."
+        alert.alertStyle = NSAlertStyle.warning
+        
+        if alert.runModal() == NSAlertFirstButtonReturn {
+            NSLog("User decided to exit...")
+            
+            NSStatusBar.system().removeStatusItem(statusItem)
+            
+            //            [self.blockstackProxyTask terminate];
+            //            NSLog(@"Blockstack Portal proxy terminated");
+            //
+            //            [self.corsProxyTask terminate];
+            //            NSLog(@"CORS proxy terminated");
+            //
+            //            [self stopBlockstackCoreApiAndExit];
+            
+            
+        }
     }
 }
 

    let corsProxyPort = 1337
    let coreProxyPort = 6270
    
    var statusItem : NSStatusItem = NSStatusItem()
    
    var isDevModeEnabled : Bool = false

        if showExpandedMenu {
            
            let portalPortMenuItem = NSMenuItem()
            portalPortMenuItem.title = "Portal proxy running on port \(portalPort())"
            portalPortMenuItem.isEnabled = false
            menu.addItem(portalPortMenuItem)
            
