remove dirs from path