adding logic for an instance of more than one checkbox group appearing on the page