fix a problem in read in graph