fix a integer overflow error