fix bug that lead to div 0