prevent duplicate paths when switching to legacy

Change-Id: I9d53fafd63ce2f2e461ab9aa5fab6f63a10141d1