   reload: ->
     es.map (file, callback) ->
       apps.forEach (app) =>
-        if app.livereload and typeof lr == "object"
-          lr.changed body:
+        if app.livereload and typeof app.lr == "object"
+          app.lr.changed body:
             files: file.path
       callback null, file
-  lr: lr
   serverClose: ->
     apps.forEach((app) -> do app.server.close)
     apps = []

    @oldMethod("open") if options.open
    @sockets = []
    @app = undefined
    @run()

  run: ->

        if @livereload
          tiny_lr.Server::error = ->
          if @https
            @lr = tiny_lr
              key: @https.key || fs.readFileSync __dirname + '/certs/server.key'
              cert: @https.cert || fs.readFileSync __dirname + '/certs/server.crt'
          else
            @lr = tiny_lr()

          @lr.listen @livereload.port
          @log "LiveReload started on port #{@livereload.port}"

  handlers: ->
