fixed 2^31-1 issue