   load = Zotero.Promise.coroutine(->
     debug('Loading Better BibTeX: starting...')
 
-    lock = new Lock()
-
     ready = Zotero.Promise.defer()
     module.exports.ready = ready.promise
     bench.start = new Date()
 
-    progressWin = new Zotero.ProgressWindow({ closeOnClick: false })
-
-    progressWin.changeHeadline('BetterBibTeX: Waiting for Zotero database')
-    progressWin.show()
+    # progressWin = new Zotero.ProgressWindow({ closeOnClick: false })
+
+    # progressWin.changeHeadline('BetterBibTeX: Waiting for Zotero database')
+    # progressWin.show()
 
     # oh FFS -- datadir is async now
-    yield Zotero.uiReadyPromise
+
+    lock = new Lock()
+    yield lock.lock('BetterBibTeX: Waiting for Zotero database...')
+
     CACHE.init()
     bench('Zotero.uiReadyPromise')
 

    yield Translators.init()
    bench('Translators.init()')

    progressWin.changeHeadline('BetterBibTeX: Ready for business')
    progressWin.startCloseTimer(500)

    # should be safe to start tests at this point. I hate async.


  class Lock
    postfix: '-better-bibtex-locked'

    lock: Zotero.Promise.coroutine((msg)->
      #@decks = {}
      #for id in [ 'zotero-items-pane-content', 'zotero-item-pane-content' ]
      #  @decks[id] = {
      #    element: document.getElementById(id)
      #    id: id
      #  }
      #  @decks[id].selected = @decks[id].element.selectedIndex
      #  do (deck = @decks[id]) =>
      #    @hide(deck.element)
      #    deck.observer = new MutationObserver((mutations) => @hide(deck.element))
      #    deck.observer.observe(deck.element, {attributes: true, childList: true})
      #    return

      yield Zotero.uiReadyPromise

      yield Zotero.unlockPromise if Zotero.locked

      Zotero.showZoteroPaneProgressMeter(msg || 'Initializing Better BibTeX...')

      @toggle(true)

      return
    )

    update: (msg) ->
      Zotero.showZoteroPaneProgressMeter(msg)
      return

    unlock: ->
      #return unless @decks

      #for id, deck of @decks
      #  deck.observer.disconnect()
      #  deck.element.selectedIndex = deck.selected
      #  deck.element.removeChild(document.getElementById(id + @postfix))
      #@decks = null

      Zotero.hideZoteroPaneOverlays()

      @toggle(false)

