Changes to search function