try{
            copy = JSON.parse(text2);
        }catch(e){
            $('#secondary').addClass("invalidJson");
            alert('The input is not valid JSON. Please check the checkboes.');