fixed logic in checkbox widget

PR on 2.2.x branch to fix logic in checkbox widget.
Merge pull request #456 from shieldo/patch-2

fixed logic in checkbox widget