update model and view.