fix some math error