diff --git a/binarycpython/utils/HPC.py b/binarycpython/utils/HPC.py
index ace9f8dae3a7a39d5f4692b3eeb093c21bddfcdb..75b66d743627bd3ffd8cc4f08200521cdddd7c28 100644
--- a/binarycpython/utils/HPC.py
+++ b/binarycpython/utils/HPC.py
@@ -27,11 +27,11 @@ class HPC(condor,slurm):
         """
         if joinlist is None:
             joinlist = self.grid_options['joinlist']
-        f = open(joinlist,'r',encoding='utf-8')
-        if f:
+        try:
+            f = open(joinlist,'r',encoding='utf-8')
             list = f.read().splitlines()
             f.close()
-        else:
+        except:
             print("Failed to open joinlist at {list}".format(list=joinlist))
             self.exit(code=1)
         return list