fix misleading exception handler for query_ns