Tracing the error and a minor change to queryWidget