added update method in model