bug fix with total