div 0 bug fix