update for search sort function