updated advanced query task