Update to enable use of beginWidget and endWidget