replace pushd,popd with cd for better POSIX compliance