fix a uint32_t overflow