updated updateModel method