fix event handling for checkboxes