sorting bug resolved in graph