automatically update the stats