fix zero division error