update search logic