diff --git a/top/firmware/hdl/link_maps.vhd b/top/firmware/hdl/link_maps.vhd
index 1490a95cb25ee3f00c0c805676a1d9748b43de77..aa1f7b582c9057a03e355bd6d4840e31d7682ac1 100644
--- a/top/firmware/hdl/link_maps.vhd
+++ b/top/firmware/hdl/link_maps.vhd
@@ -28,12 +28,14 @@ end package dtc_link_maps;
 package body dtc_link_maps is
 
     function selectModuleTypeFromChannel(channel : in integer) return string is
+        variable module_type : string(1 to 2);
     begin
         for i in 0 to cDTCInputLinkMap'length - 1 loop
             if cDTCInputLinkMap(i).index = channel then
-                return cDTCInputLinkMap(i).module_type;
+                module_type := cDTCInputLinkMap(i).module_type;
             end if;
         end loop;
+        return module_type;
     end selectModuleTypeFromChannel;
 
     function selectDataRateFromChannel(channel : in integer) return integer is