update to search function