change widget.factory to widget.extend