diff --git a/build_pdata.sh b/build_pdata.sh
index 16d4121e90a9d5fae1c0a99387a1562fda949ad7..4e4e1720bb7a44faa0cb694781563955e2f44190 100644
--- a/build_pdata.sh
+++ b/build_pdata.sh
@@ -21,6 +21,7 @@ fi
 
 # pull from all the projects
 cd openfpm_data
+git checkout develop
 mkdir src/config
 git pull origin develop
 if [ $? -ne 0 ]; then
@@ -56,9 +57,6 @@ if [ $? -ne 0 ]; then
 fi
 cd ..
 
-cd openfpm_data
-git checkout develop
-cd ..
 
 if [ "$2" == "gin" ]
 then