fix view model and model bugs