query syntax fix