         @kill name
       ,die.after
 
+
+    @child.on 'exit', ()=>
+      console.log "[PROCESSES][#{name}] did exit." if verbose
+      @emit "exit",@child.pid,name
+      delete @list[name]
+    @child.on 'close', () =>
+      console.log "[PROCESSES][#{name}] did close." if verbose
+      @emit "close",@child.pid,name
+      onExit @child.pid,name
+      if restart is yes
+        restartInterval = 1 unless restartInterval
+        setTimeout =>
+          @run options
+        ,restartInterval
+        console.log "[PROCESSES][#{name}] restarting the process in #{restartInterval} msecs." if verbose
     @child.on 'message',(msg) =>
       onMessage msg if "function" is typeof onMessage
       if msg['process-monitor']
         @emit "monitorData", msg
       else if options.kontrol?.enabled and options.kontrol?.nodeProcess
         @emit "childData", msg
-
-    # kontrold uses his own onExit and onClose
-    unless options.kontrol?.enabled
-      @child.on 'exit', ()=>
-        console.log "[PROCESSES][#{name}] did exit." if verbose
-        @emit "exit",@child.pid,name
-        delete @list[name]
-      @child.on 'close', () =>
-        console.log "[PROCESSES][#{name}] did close." if verbose
-        @emit "close",@child.pid,name
-        onExit @child.pid,name
-        if restart is yes
-          restartInterval = 1 unless restartInterval
-          setTimeout =>
-            @run options
-          ,restartInterval
-          console.log "[PROCESSES][#{name}] restarting the process in #{restartInterval} msecs." if verbose
 
     # console.log @list
     return childObj

          #############
          ### Child ###
          #############

          onExit ?= ->
          @child.on 'exit', ()=>
            console.log "[PROCESSES][#{name}] did exit." if verbose
            @emit "exit",@child.pid,name
            delete @list[name]
            workerProcess.stopReporter()
            workerProcess.worker.status = 4
            workerProcess.fetchWorkerExchange (workerExchange) =>
              workerProcess.worker.message.command = "ack"
              workerExchange.publish "input.worker", {worker: workerProcess.worker},
                appId: "#{workerProcess.worker.uuid}"

          @child.on 'close', () =>
            console.log "[PROCESSES][#{name}] did close." if verbose
            @emit "close",@child.pid,name
            onExit @child.pid,name
            if restart is yes
              restartInterval = 1 unless restartInterval
              setTimeout =>
                @run options
              ,restartInterval
              console.log "[PROCESSES][#{name}] restarting the process in #{restartInterval} msecs." if verbose

          workerProcess.startReporter()
          # Update kontrold worker information with our newly created pid.

      workerProcess.worker.status = 4
      console.log "[PROCESSES][#{name}] received 'kill' message from Kontrold. Sending SIGTERM to the child_process." if verbose
      # @child.kill 'SIGKILL' #try this in the future
      # workerProcess.stopReporter() #TODO think about it
      @kill name

    #############
