diff --git a/etc/cmake/UseArmarXGui.cmake b/etc/cmake/UseArmarXGui.cmake
index 0f5773652e7c0667c03de32dced33beb096a02e4..d8477067492fa5466228aa528c357735793ff2a6 100644
--- a/etc/cmake/UseArmarXGui.cmake
+++ b/etc/cmake/UseArmarXGui.cmake
@@ -106,7 +106,7 @@ function(armarx_gui_plugin PLUGIN_NAME SOURCES QT_MOC_HDRS QT_UIS QT_RESOURCES C
         if(NOT "1" STREQUAL "${tmp_headers_len}")
             message(FATAL_ERROR "Failed to auto generate the GuiPlugin headers! Error: Can't find the widget controller")
         endif()
-        list(POP_BACK tmp_headers tmp_hdr)
+        list(GET tmp_headers 0 tmp_hdr)
         set(ARMARX_GUI_PLUGIN_WIDGET_CONTROLLER_HEDER "${subdir}/${tmp_hdr}")
         ########################################################################
         #generate and add files