typo fixed (pop -> popd).