fix inaccurate computation