fix phase total calculation