diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 860a1f76e394a643a113ede1b95ac5fca8be2750..0c608c8a1f31c9e3a1255371e2754c520e7c20e4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,7 +5,8 @@
   
   before_script:
       - apt update
-      - apt -y install git sudo
+      - apt -y install git #add to docker image?
+      - apt -y install sudo #needed for sudo commands in privileges.sh script
       - which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
       - eval $(ssh-agent -s)
       - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
@@ -14,8 +15,6 @@
       - ssh-keyscan -p 2202 gitlab.iri.upc.edu  >> ~/.ssh/known_hosts
       - chmod 644 ~/.ssh/known_hosts
       - ssh -p 2202 git@gitlab.iri.upc.edu #test
-      - apt update
-      - apt -y install git
       - git submodule sync --recursive
       - git submodule update --init --recursive
 
@@ -29,12 +28,14 @@
     script:
       - apt update
       - apt -y install iri-iriutils-dev iri-comm-dev iri-dynamixel-dev
+      - apt -y install gcc-avr avr-libc #firmware dependencies
       - mkdir -pv build
       - cd build
       - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCPACK_PACKAGE_VERSION=$CI_COMMIT_TAG ..
       - ls ..
-      - make package -j $(nproc)
       - make firmware -j $(nproc)
+      - make package -j $(nproc)
+      
     artifacts:
       paths:
         - build/*.deb
@@ -49,6 +50,4 @@
       - "scp -i /root/.ssh/iriLabKeyNopwd -r *battery-monitor*.deb irilabo@147.83.76.226:packages/"
       - "ssh irilabo@147.83.76.226 -i /root/.ssh/iriLabKeyNopwd -tt /home/irilabo/repo_scripts/update_repo.sh battery-monitor"
     only:
-      - tags
-
-   
\ No newline at end of file
+      - tags
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6a720e01c18724a9914dc3f4e08a5bf50d787e3d..fc4ef31ec3559ed5e82a7fb039a37f70e8c98a70 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -64,4 +64,5 @@ add_custom_target(firmware COMMAND make
 INSTALL(FILES 
           ${CMAKE_CURRENT_SOURCE_DIR}/../${firmware_dir}/avr8_battery_monitor_eeprom.hex
           ${CMAKE_CURRENT_SOURCE_DIR}/../${firmware_dir}/avr8_battery_monitor.hex
-        DESTINATION lib/firmware/iri/${PROJECT_NAME})
\ No newline at end of file
+        DESTINATION lib/firmware/iri/${PROJECT_NAME}
+        OPTIONAL)
\ No newline at end of file