diff --git a/jenkins/Jenkinsfile-empty b/jenkins/Jenkinsfile-empty
index d834c9e8dd9ef57a3e769b036b9009f6ac061bf2..c37e7b91deea84be65fc80cfc2b29b8c4124ad85 100644
--- a/jenkins/Jenkinsfile-empty
+++ b/jenkins/Jenkinsfile-empty
@@ -11,9 +11,9 @@ pipeline{
                             sh "mkdir ${SUBDIR}"
                             sh "cd ${SUBDIR}"
                             git branch: "${CHECKOUTBRANCH}", url: "${CHECKOUTREPO}"
-                            cleanWs()
                             sh "cd .."
                             sh "rm -rf ${SUBDIR}"
+                            cleanWs()
                         }    
                     }
                 }