fix for rounding errors