fixed logic in checkbox widget

There was a logical case where a <label> element could have been closed but not opened within the checkbox widget - this change fixes this.