Updates to advanced query