fixing the problem that can't compute correct value