update model and view