attempt to fix floating point error