diff --git a/matlab/TCV_IMAS/tcv_get_ids_core_sources.m b/matlab/TCV_IMAS/tcv_get_ids_core_sources.m
index 2e598bb85ce17983dcf90ac7092a7e5daabd0e20..bd6a9e3b22fb175ec2c68a5162c2f995986b318e 100644
--- a/matlab/TCV_IMAS/tcv_get_ids_core_sources.m
+++ b/matlab/TCV_IMAS/tcv_get_ids_core_sources.m
@@ -387,6 +387,7 @@ id_nbi.index = 2; id_nbi.name = 'nbi';
 disp('Loading of current & power densities from ASTRA not implemented yet.')
 disp('Checking if ASTRA run available on partition /Lac8_D:')
 [~,hostname] = unix('hostname');
+hostname = hostname(~isspace(hostname));
 if strcmp(hostname,'lac8.epfl.ch')
   unix(sprintf('ls /Lac8_D/ASTRA/ | grep ''%i'' && echo File for shotnumber exists! || echo File for shotnumber does not exist!',shot));
 else