add braces to query