fix overflow issue in main