diff --git a/src/freedombone b/src/freedombone
index 6422efd8254b5883510effaf9cf5c19a822ef2bf..35f70cf9ab0f88b174068a1100fa496ff99b9b17 100755
--- a/src/freedombone
+++ b/src/freedombone
@@ -2104,13 +2104,14 @@ function mesh_cjdns_tools {
     if [ ! -f ~/.bashrc ]; then
         touch ~/.bashrc
     fi
+    export GOPATH=$HOME/projects/go
     if ! grep -q "export GOPATH=" ~/.bashrc; then
         echo 'export GOPATH=$HOME/projects/go' >> ~/.bashrc
     fi
     if ! grep -q "export PATH=$PATH:$HOME/projects/go/bin" ~/.bashrc; then
+        export PATH=$PATH:$HOME/projects/go/bin
         echo 'export PATH=$PATH:$HOME/projects/go/bin' >> ~/.bashrc
     fi
-    . ~/.bashrc
     export GOPATH=$HOME/projects/go
     export PATH=$PATH:$HOME/projects/go/bin
     go get github.com/inhies/cjdcmd
@@ -6401,6 +6402,7 @@ function install_gogs {
     fi
 
     export GOPATH=/home/git/go
+    systemctl set-environment GOPATH=/home/git/go
 
     # update to the next commit
     if [ -d /var/www/$GIT_DOMAIN_NAME ]; then
@@ -6446,7 +6448,6 @@ function install_gogs {
         echo 'export GOPATH=/home/git/go' >> ~/.bashrc
         echo 'systemctl set-environment GOPATH=/home/git/go' >> ~/.bashrc
     fi
-    . ~/.bashrc
     if [ ! -d $GOPATH ]; then
         mkdir -p $GOPATH
     fi
@@ -9382,6 +9383,9 @@ function install_ipfs {
         return
     fi
 
+    export GOPATH=/home/git/go
+    systemctl set-environment GOPATH=/home/git/go
+
     # update to the next commit
     if [ -d /home/git/go/src/github.com/ipfs/go-ipfs ]; then
         if grep -q "ipfs commit" $COMPLETION_FILE; then
@@ -9417,7 +9421,6 @@ function install_ipfs {
             echo 'export GOPATH=/home/git/go' >> ~/.bashrc
             echo 'systemctl set-environment GOPATH=/home/git/go' >> ~/.bashrc
         fi
-        . ~/.bashrc
         export GOPATH=/home/git/go
         if [ ! -d $GOPATH ]; then
             mkdir -p $GOPATH
@@ -9426,9 +9429,9 @@ function install_ipfs {
 
     IPFS_PATH=/home/git/go/bin
     if ! grep -q 'GOPATH/bin' ~/.bashrc; then
+        export PATH="$GOPATH/bin:$PATH:"
         echo 'export PATH="$GOPATH/bin:$PATH:";' >> ~/.bashrc
     fi
-    . ~/.bashrc
 
     # set gopath for the user
     if ! grep -q "GOPATH=" /home/$MY_USERNAME/.bashrc; then
diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise
index 3aeea5424f9e87609e5b2c3d3d743dcbb8ec687a..e1ee2e6047f0250a860a26c595b4f56acb3f80d8 100755
--- a/src/freedombone-image-customise
+++ b/src/freedombone-image-customise
@@ -242,10 +242,8 @@ if [ -f ~/.initial_setup ]; then
 fi
 EOF
 
-    cat >> $rootdir/root/.bashrc <<EOF
-# initial setup of the system
-if [ -f ~/.initial_setup ]; then
-EOF
+    echo '# initial setup of the system' >> $rootdir/root/.bashrc
+    echo 'if [ -f ~/.initial_setup ]; then' >> $rootdir/root/.bashrc
     echo '    if [ -f ~/login.txt ]; then' >> $rootdir/root/.bashrc
     echo '        NEW_USER_PASSWORD=$(printf `cat ~/login.txt`)' >> $rootdir/root/.bashrc
     echo '    else' >> $rootdir/root/.bashrc