update search fucntion