BUGFIX: missed parens in local query