fix div 0 bug