Added update function