bug fix zero division error