Ammend sum_by