fix divide by zero error in stats