Fix a minor bug in the widget behavior