update loading code for graphs.