fix a bug in mapgraph