Bug fix with dijkstra path