update method.