Added data updating logic