fix stats logging