fixed the integer conversion