fix bugs of overflow