Fix: Updated popd functionality