fixed sort_by