fix error when pickling frozen graphs