Fix a typo on variable name

sort_by ->
group_by