fix overflows