Update search() function