assure that JSON structure is freed when done