first bugfix for Dijkstra