Updated the update method