fixed int overflow issue