fixed another case for dijkstra