fix for overflow issues