diff --git a/target/chroot/beagleboard.org.sh b/target/chroot/beagleboard.org.sh
index e03437b185f26be930c2c1436243a9fb1d0c983d..800c3c2f61b8cac0b90bdf84e63e735c10d41f8c 100755
--- a/target/chroot/beagleboard.org.sh
+++ b/target/chroot/beagleboard.org.sh
@@ -213,7 +213,9 @@ install_repos () {
 	chown -R ${user_name}:${user_name} /opt/cloud9/
 
 	if [ -f /opt/scripts/mods/cloud9-systemd-fix.diff ] ; then
+		cd /opt/cloud9/
 		patch -p1 < /opt/scripts/mods/cloud9-systemd-fix.diff
+		cd /opt/
 	fi
 
 	#git_repo="https://github.com/ajaxorg/cloud9.git"