Added stats logging to file