fix sum_loss