update the model and controller