diff --git a/build_sec_OS.sh b/build_sec_OS.sh
index e6ef722e58c43696489aa64b15f8d4980e7c0df2..d24f55964b0d3c9536f0addb18ed1c513c62ac8d 100755
--- a/build_sec_OS.sh
+++ b/build_sec_OS.sh
@@ -16,7 +16,7 @@ if [ "$2" == "windows10" ]; then
     echo "y" >> input_install
     echo "1" >> input_install
 
-    branch=$(git rev-parse --abbrev-ref HEAD)    
+    branch=$(git ls-remote --heads origin | grep $(git rev-parse HEAD) | cut -d / -f 3)    
 
     ./install -i "/home/jenkins/$branch" < input_install