fix overflow treatment