     buffer = ''
 
     @proc.stdout.on 'data', (chunk) =>
-      if ~chunk.indexOf("END-OF-#{@last_request_type}")
-        [before, after] = chunk.toString().split("END-OF-#{@last_request_type}")
+      if ~chunk.indexOf("END-OF-#{@lastRequestType}")
+        [before, after] = chunk.toString().split("END-OF-#{@lastRequestType}")
         @busy = false
         @onResult((buffer + before).trim())
         if after
           buffer = after
         else
           buffer = ''
+        if @lastRequestWhenBusy?
+          [type, args, onResult] = @lastRequestWhenBusy
+          @lastRequestWhenBusy = null
+          console.log("Retrying last request when busy")
+          @sendRequest(type, args, onResult)
       else
         buffer += chunk.toString()
       return

    @args        = [path.join(__dirname, "alchemist-server/run.exs"), "dev"]
    @proc        = null
    @busy        = false
    @last_request_type = null

  start: ->
    @proc = @spawnChildProcess()

    if !@busy
      @onResult = onResult
      @busy = true
      @lastRequestType = type
      @proc.stdin.write(request);
    else
      console.log('Server busy!')
      @lastRequestWhenBusy = [type, args, onResult]

  spawnChildProcess: ->
    options =
