fixed bug in Graph