fixed logic in checkbox widget

PR on 2.2.x branch to fix logic in checkbox widget.