rewrite dir paths