fix total 0 case