fix shortest path and main