fix logic error in conditional for checkboxes.