fix overflow problem