fix query syntax