modify the update method