Fix pushd/popd issue