fix minor overflow bug