updated advanced querys to remove duplicate header