hotfix calculating total