fix relative middleware paths