Catch JSON parse exception
Added missing variable test