update model and repository