improved error handling and start of stats