changed the update method