fix double-creation bug in graph.fromJSON