fixing bug in graph processing