fixed bug in makegraph