def update method