fixed advanced search so the toggle works