Modify sort method in complete tasks