logic for radio buttons