diff --git a/utils.py b/utils.py
index 0792dc0237e35a37d80bc45950827d223c76ddc3..860e3dd16a505b51ccdc2ca1d251b0edf2cce7ed 100755
--- a/utils.py
+++ b/utils.py
@@ -123,8 +123,11 @@ class Resource:
 
 
 class EventProcessor(pyinotify.ProcessEvent):
+    def __init__(self, server):
+        self.server = server
+
     def process_IN_CLOSE_WRITE(self, event):
-        server.process(event.path)
+        self.server.process(event.path)
 
 
 class Server:
@@ -132,7 +135,7 @@ class Server:
 
     def __init__(self):
         self.watch_manager = pyinotify.WatchManager()
-        self.event_notifier = pyinotify.ThreadedNotifier(self.watch_manager, EventProcessor())
+        self.event_notifier = pyinotify.ThreadedNotifier(self.watch_manager, EventProcessor(self))
         self.event_notifier.start()
 
     def add_watch(self, domain, location):