fixed calculate problem