diff --git a/lib/ORM.js b/lib/ORM.js
index <HASH>..<HASH> 100644
--- a/lib/ORM.js
+++ b/lib/ORM.js
@@ -57,8 +57,19 @@ exports.connect = function (opts, cb) {
 
 	try {
 		var Driver = require("./Drivers/DML/" + proto).Driver;
+		var debug = (opts.query && Boolean(opts.query.debug));
+
+		if (debug) {
+			delete opts.query.debug;
+			if (opts.href) {
+				opts.href = opts.href.replace(/debug=[^\&]+&?/, '');
+			}
+			if (opts.search) {
+				opts.search = opts.search.replace(/debug=[^\&]+&?/, '');
+			}
+		}
 		var driver = new Driver(opts, null, {
-			debug: (opts.query && opts.query.debug == 'true')
+			debug: debug
 		});
 
 		driver.connect(function (err) {
Extracts debug option (if exists) from query to pass it to ORM and not to driver