floating point bug fix