change method endWidget() to end()