Use pushd/popd instead of subshell