fixed bugs in serialization
graph serializes right after loading