Search  function updated