fixed bug in graph