Add error catching on stats script