bpqueries do_query fix