bugs fix for graphs