Update search function