fixed floating point math error