avoid extra / on empty prefix