fixed integer overflow problem