adding some update logic