fixed calculate bug