         @emit "AppCouldntBeCreated", appInstance
         @utils.defer => @quitByName appOptions.name, yes
         return no
+
+    log 'AppManager: opening an app', name
+    if @checkAppAvailability name
+      log 'AppManager: couldn\'t find', name
+      return KodingAppsController.putAppScript name, (err)=>
+        log 'AppManager: loaded', name
+        return warn err  if err
+        KD.utils.defer => @create name, params, callback
+
 
     @utils.defer =>
       return @emit "AppCouldntBeCreated"  unless appInstance

  ###

  manifestsFetched = no

  @checkAppAvailability = (name='')->
    return (name.toLowerCase() in KD.config.allowedApps) and\
           (name not in Object.keys KD.appClasses)

  constructor:->


      appParams            = options.params or {}
      defaultCallback      = createOrShow.bind this, appOptions, appParams, callback
      kodingAppsController = KD.getSingleton("kodingAppsController")

      # If app has a preCondition then first check condition in it
      # if it returns true then continue, otherwise call failure
