Change calls to Query constructor to Dashboards.getQuery, instead.