diff --git a/Makefile b/Makefile
index e31ad476f84e822e3f2d339e192dd78197eebb28..9e4182929115302476a0611cf9970640f915df04 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ PROJECT_DOCKER_RUN_ARGS := --link db:db
 
 default: build
 
-.PHONY: test run test-without-lint test-pylint fmt test-without-build build
+.PHONY: test run test-without-lint test-pylint fmt test-without-build build docs
 
 docs:
 	pdoc --html hive --html-dir docs
diff --git a/hive/conf.py b/hive/conf.py
index 81e1d3dbb843276e7913ede0593a1a0d7e936fbb..cab3952862c138ff9f64b38ef85a1340b7b04c38 100644
--- a/hive/conf.py
+++ b/hive/conf.py
@@ -42,6 +42,13 @@ class Conf():
         assert cls._args, "run init_argparse()"
         return getattr(cls._args, param)
 
+    @classmethod
+    def run_mode(cls):
+        mode = '/'.join(cls.get('mode'))
+        valid = ['server', 'sync', 'status']
+        assert mode in valid, "invalid run mode %s" % mode
+        return mode
+
     @classmethod
     def log_level(cls):
         str_log_level = cls.get('log_level')
diff --git a/run.py b/run.py
index b52ac1554b379096e67f298162e224d69f4aa62d..7f4060a2d6d72f8ec5dc3a771606641cfe22f10a 100755
--- a/run.py
+++ b/run.py
@@ -7,7 +7,7 @@ from hive.server.serve import run_server
 
 def run():
     Conf.init_argparse()
-    mode = '/'.join(Conf.get('mode'))
+    mode = Conf.run_mode()
 
     if mode == 'server':
         run_server()