fixed TypeError in update_model