fix uint64_t overflow