some bugfixes to run the djikstra