update sort method