fixed bug due to rounding/float/int conversion