correct logic for switching to advanced search