         # Deprecated: this only tests the existence
         check = (v, k, cb) =>
             #if DEBUG then console.log("init_library.check", v, k)
-            store = @get_store()
-            return if not store?
+            if not store = @get_store()
+                cb("no store")
+                return
             if store.library?.get(k)?
+                cb("already done")
                 return
             src = v.src
             cmd = "test -e #{src}"

            status : undefined    # status update message during the activity -- description of progress
            stop   : undefined    # activity is done  -- can pass a final status message in.
            error  : undefined    # describe an error that happened
        store = @get_store()
        if not store?  # if store not initialized we can't set activity
            return
        x = store.activity?.toJS()
        if not x?
            x = {}


    # Used by open/close chat below.
    _set_chat_state: (path, is_chat_open) =>
        return if not store = @get_store()
        open_files = store.open_files
        if open_files? and path?
            @setState
                open_files : open_files.setIn([path, 'is_chat_open'], is_chat_open)
