fixed overflow

Signed-off-by: Serg Brych <sbrych@gmail.com>