link before changing directory to preserve paths