         $rootScope.$broadcast 'gateblu:stdout', data, device
         $rootScope.$apply()
 
-      @gateblu.on "unregistered", ->
+      @gateblu.on "unregistered", =>
         @stopDevices =>
           @gateblu.removeAllListeners()
 

    path          = require 'path'
    Gateblu       = require 'gateblu'


    init = =>
      config = configManager.loadConfig()
      unless @config
        configManager.saveConfig()
        config = configManager.loadConfig()


        @gateblu.cleanup()

      process.on 'uncaughtException', (error) =>
        console.error 'uncaughtException'
        console.error error.message
        console.error error.stack
        @gateblu.cleanup()

      @gateblu.on 'gateblu:config', (config) =>
