search function update