 
   getPublishedApps: (callback) ->
     # return unless KD.isLoggedIn()
-    @fetchApps (err, apps) =>
-      appNames = []
-      appNames.push appName for appName, manifest of apps
-
-      query = "manifest.name": "$in": appNames
-      KD.remote.api.JApp.someWithRelationship query, {}, (err, apps) =>
-        @publishedApps = map = {}
-        apps.forEach (app) =>
-          map[app.manifest.name] = app
-        @emit "UserAppModelsFetched", map
-        callback? map
+    appNames = []
+    appNames.push appName for appName, manifest of @getManifests()
+
+    query = "manifest.name": "$in": appNames
+    KD.remote.api.JApp.someWithRelationship query, {}, (err, apps) =>
+      @publishedApps = map = {}
+      apps.forEach (app) =>
+        map[app.manifest.name] = app
+      @emit "UserAppModelsFetched", map
+      callback? map
 
   isAppUpdateAvailable: (appName, appVersion) ->
     if @publishedApps[appName]

    @_fetchQueue    = []
    @appStorage     = KD.getSingleton('appStorageController').storage 'Finder', '1.1'

    @getPublishedApps()
    @createExtensionToAppMap()
    @fetchUserDefaultAppConfig()

    @on "UpdateDefaultAppConfig", (extension, appName) =>
      @updateDefaultAppConfig extension, appName


  createExtensionToAppMap: ->
    @extensionToApp = map = {}

    for key, app of @getManifests()
      fileTypes = app.fileTypes
      if fileTypes
        for type in fileTypes
          map[type] = [] unless map[type]
          map[type].push app.name

    # Still there should be a more elagant way to add ace file types into map.
    for type in KD.getAppOptions("Ace").fileTypes
      map[type] = [] unless map[type]
      map[type].push "Ace"

  fetchUserDefaultAppConfig: ->
    @appConfigStorage = new AppStorage "DefaultAppConfig", "1.0"
