fix casting from float to int