implemented update function for statitics