 
     private var loginsDBCreated = false
     private lazy var loginsDB: BrowserDB = {
-        self.loginsDBCreated = true
-        return BrowserDB(filename: "logins.db", secretKey: self.loginsKey, files: self.files)
+        struct Singleton {
+            static var token: dispatch_once_t = 0
+            static var instance: BrowserDB!
+        }
+        dispatch_once(&Singleton.token) {
+            Singleton.instance = BrowserDB(filename: "logins.db", secretKey: self.loginsKey, files: self.files)
+            self.loginsDBCreated = true
+        }
+        return Singleton.instance
     }()
 
     let accountConfiguration: FirefoxAccountConfiguration = ProductionFirefoxAccountConfiguration()

    }

    lazy var queue: TabQueue = {
        if !self.dbCreated {
            _ = self.history
        }
        return SQLiteQueue(db: self.db)
    }()

    private var dbCreated = false
    lazy var db: BrowserDB = {
        self.dbCreated = true
        return BrowserDB(filename: "browser.db", files: self.files)
    }()


    /**
     * Favicons, history, and bookmarks are all stored in one intermeshed

    }

    func shutdown() {
        if self.dbCreated {
            db.close()
        }

        if self.loginsDBCreated {
            loginsDB.close()
        }
    }
