update generate stats script.