Found a better way (that works) to get the value of the checkboxes.