diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml
index e24f2d3fb791f4cf0e4e3f6ff922fbd0ff766063..1cc940514f3bea2716e50b57676618321c3bf16d 100644
--- a/.gitlab/ci/build.gitlab-ci.yml
+++ b/.gitlab/ci/build.gitlab-ci.yml
@@ -15,6 +15,8 @@ build:ubuntu_cpp:
     - apt-get -qq install -y jq
     # Check if a branch with the same name exist on the dependance repository
     - >
+      set -x
+      BRANCH_TO_PULL="dev" # default branch
       if [ "$CI_MERGE_REQUEST_ID" ]; then
           echo "Merge request pipeline detected"
           if [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME") -eq 404 ]; then
@@ -24,13 +26,12 @@ build:ubuntu_cpp:
               echo "Pull from ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
               BRANCH_TO_PULL=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
           fi
-      elif [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME") -eq 404 ]; then
-          BRANCH_TO_PULL="dev" # default branch
-      else
+      elif [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME") -ne 404 ]; then
           # Pulling from branch with same name
           BRANCH_TO_PULL=${CI_COMMIT_REF_NAME}
       fi
       echo "Pull from branch : ${BRANCH_TO_PULL}"
+      set +x
 
     # Check group namespace is valid, if it is then we are in the official project(aidge group id=6437), otherwise we pull from the fork 
     - >