fix sort graph