Changes function for-each to work on new checkboxes