properly avoid that integer overflow