           @workerProcess[name].startReporter "ack"
           @workerProcess[name].stopReporter "add"
           # Update kontrold worker information with our newly created pid.
-          setTimeout =>
+          setTimeout(=>
             @workerProcess[name].fetchWorkerExchange (workerExchange) =>
               @workerProcess[name].worker.message.command = "update"
-              @workerProcess[name].worker.status = 0
-              @workerProcess[name].worker.pid = @list[name].pid
-              @workerProcess[name].worker.timestamp = @getDate()
-              workerExchange.publish "input.worker", {worker: @workerProcess[name].worker},
+              @workerProcess[name].worker.status          = 0
+              @workerProcess[name].worker.pid             = @list[name].pid
+              @workerProcess[name].worker.timestamp       = @getDate()
+              workerExchange.publish "input.worker", {
+                worker: @workerProcess[name].worker
+              }, {
                 appId: "#{@workerProcess[name].worker.uuid}"
-          , 5000
+              }
+          , 5000)
 
     #############
     ### Kill  ###

      @kill name

  populateChildObject: (options, @child) ->
    {name,onMessage,modulePath,args,restart,restartTimeout,cmd,log,onExit,stdout,stderr,verbose,die} = options
    onExit ?= ->
    console.log "[PROCESSES][#{name}] started the process: #{name} with pid: #{@child.pid}" if verbose
    @createPidFile @child.pid,name

    childObj =
      name    : name

        #else
        #  console.log "previous process tree is deleted."
        
  fork: (options, callback) ->
    options.fork = yes
    @run options, callback, (cb) =>
      callback cb

  spawn: (options, callback) ->
    options.spawn = yes
    @run options, callback

  exec: (cmd, callback) ->
    @spawn
      name    : Date.now()
      cmd     : cmd
      restart : no
      stdout  : process.stdout
      stderr  : process.stderr
      onExit  : callback

  # our main function is this. Either it is started normal, or it is wrapped
  # via kontrold amqp process
  run: (options, callback) ->
    { name, restartTimeout, verbose } = options

    options.name            ?= Date.now()
    options.restartTimeout  ?= 1000
