another #sort_by fix