fixes for overflow