Added basic error checking for checkbox and radiogroup