diff --git a/generate-deploy-stages.sh b/generate-deploy-stages.sh
index 2cc1b8b9c0a8ed5c215eb68821e1cd84dddb7304..69fbbe06dedc1f7c58d034b16216f85f744c8162 100644
--- a/generate-deploy-stages.sh
+++ b/generate-deploy-stages.sh
@@ -11,6 +11,7 @@ if [ ! -z "${TAG}" ]; then
   git clone --single-branch --branch ${TAG} https://github.com/MAAP-Project/maap-workspaces.git
   pushd maap-workspaces
   ls -d base_images/*/* > ${basedir}/images.txt
+  popd
   cat ${basedir}/images.txt
   template="${basedir}/deploy.yml.tmpl"
   cat ${basedir}/images.txt | while read image