         switch notification.name {
         case NotificationFirefoxAccountChanged:
             self.reloadData()
+            break
+        case UITextFieldTextDidChangeNotification:
+            if let okAction = addBookmarksFolderOkAction, let textField = notification.object as? UITextField {
+                okAction.enabled = (textField.text?.characters.count > 0)
+            }
             break
         default:
             // no need to do anything at all

        alert.addTextFieldWithConfigurationHandler({(textField: UITextField!) in
            textField.placeholder = "<folder name>"
            textField.secureTextEntry = false
        })
        
        self.presentViewController(alert, animated: true) {}
    }

    func addFolder(alert: UIAlertAction!, alertController: UIAlertController) {
        if let folderName = alertController.textFields?[0].text  {
            if let sqllitbk = self.profile.bookmarks as? MergedSQLiteBookmarks {
                sqllitbk.createFolder(folderName).upon { _ in
                    postAsyncToMain {

    func onAddBookmarksFolderButton() {
        
        let alert = UIAlertController(title: "New Folder", message: "Enter folder name", preferredStyle: UIAlertControllerStyle.Alert)
        
        let removeTextFieldObserver = {
            NSNotificationCenter.defaultCenter().removeObserver(self, name: UITextFieldTextDidChangeNotification, object: alert.textFields!.first)
        }

        let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) { (alertA: UIAlertAction!) in
            postAsyncToMain {
                self.addFolder(alertA, alertController:alert)
            }
            removeTextFieldObserver()
        }
        
        okAction.enabled = false
        
        addBookmarksFolderOkAction = okAction
        
        let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel) { (alertA: UIAlertAction!) in
            removeTextFieldObserver()
        }
        
        alert.addAction(okAction)
        alert.addAction(cancelAction)
