Adding update logic