diff --git a/exec/json-service.js b/exec/json-service.js
index 9c903ec2371c60ec906e99e495a5becba4a95cd3..74d9d42f6ea348aa0d7617632e0f221b3e0e93e4 100644
--- a/exec/json-service.js
+++ b/exec/json-service.js
@@ -482,7 +482,7 @@ engine = new (function() {
 		this.name = name;
 		this.dir = dir;
 		this.queue = undefined;
-		this.db = new JSONdb(this.dir+this.name+".json");
+		this.db;
 		this.init = function() {
 			/* load module service files */
 			if(file_exists(this.dir + "service.js")) {
@@ -492,6 +492,7 @@ engine = new (function() {
 					log(LOG_ERROR,"error loading module: " + this.name);
 				}
 			}
+			this.db = new JSONdb(this.dir+this.name+".json");
 		}
 		this.init();
 	}