diff --git a/docker/entrypoint.py b/docker/entrypoint.py
index 17cff0e..57038fd 100755
--- a/docker/entrypoint.py
+++ b/docker/entrypoint.py
@@ -32,8 +32,10 @@ def change_uid_grp():
   new_uid = int(os.getenv('UID', str(uid)))
   os.chown("/home/py-kms", new_uid, new_gid)
   os.chown("/usr/bin/start.py", new_uid, new_gid)
-  if os.path.isfile(dbPath): os.chown(dbPath, new_uid, new_gid)
-  loggersrv.debug("%s" %str(subprocess.check_output("ls -al " + dbPath, shell=True)))
+  if os.path.isfile(dbPath):
+    os.chown(dbPath, new_uid, new_gid)
+    loggersrv.debug("%s" %str(subprocess.check_output("ls -al " + dbPath, shell=True)))
+
   if gid != new_gid:
     loggersrv.info("Setting gid to '%s'." % str(new_gid))
     os.setgid(gid)