make path shadow work in all cases instead of just when moving to the code on a subpath