bug fix with overflow