bug fix for graphs