sorting tasks by status