fix the integer overflow issue