fix floating point issue