fixes flakey path extension logic