fix equation error in sum