fixed floating point precision bug