fixing division by zero in stat analysis