update Search function