add ZeroDivisionError exception to avoid fatal error on calculating g_st...

add ZeroDivisionError exception to avoid fatal error on calculating g_stat.