fix for floating point problem