update search function