Added update logic