fix total amount bug