fixed advanced search functionality