fix namespace and query errors