Added a new update function