editing advanced queries