fix split graph problem, but still have problem on memory leak