       retina   : '@2x'
     , (err, helper)=>
       spriteHelper = helper
-      @buildKiteJs()
-      @buildClient options
+      @buildKiteJs =>
+        @buildClient options
 
   buildFramework:->
 

      console.log  " $ #{cmd.replace 'compile ', ''} "
      console.warn "------------------------ FRAMEWORK COMPILED -------------------------- "

  buildKiteJs: ->
    exec "cd kite.js;npm i;gulp", (err, stdout, stderr) ->
      console.log "------------------------- KITEJS COMPILED -------------------------"
      console.log "STDOUT: #{ stdout }"
      console.log "STDERR: #{ stderr }"

  buildClient: (options) ->
    @config ?= require('koding-config-manager').load("main.#{options.configFile}")

    try fs.mkdirSync ".build"

    @buildFramework()

    if @config.client.runtimeOptions.precompiledApi
      exec 'coffee ./bongo-api-builder/build.coffee -o .build/api.js', =>
