code for live data update