diff --git a/src/freedombone-utils-elixir b/src/freedombone-utils-elixir
index 7b243dd7f6b317e1725c9dc3c720cfc72d9e9640..58d03d2aec034a60531e8a0ed179ccf08e9d5df5 100755
--- a/src/freedombone-utils-elixir
+++ b/src/freedombone-utils-elixir
@@ -78,11 +78,11 @@ function image_install_elixir {
     fi
 
     { echo '#!/bin/bash';
-      echo "cd $INSTALL_DIR";
+      echo "cd $INSTALL_DIR || exit 1";
       echo "erlang_package=$erlang_package";
       echo "wget https://packages.erlang-solutions.com/\$erlang_package";
       echo "if [ ! -f \"\$INSTALL_DIR/\$erlang_package\" ]; then";
-      echo '    exit 1';
+      echo '    exit 2';
       echo 'fi';
       echo "dpkg -i \$erlang_package"; } > "$rootdir/usr/bin/install_elixir"
     chmod +x "$rootdir/usr/bin/install_elixir"