corrected overflow bug