update stats check & clear some code