shortest path fix