Controls fix

Fixing the dbQuery function