diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index 56c058a6c3ecf9a53d374b8c7a5738b022176e50..6503173c3c983f4e36dab8e0b6bc57197dc55a8d 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -82,19 +82,18 @@ def run():
             clvr_file = clvr_ds.get_file(time)
             if clvr_file is None:
                 continue
-            if last_clvr_file is None:
+            if clvr_file != last_clvr_file:
+                try:
+                    h5f = h5py.File(clvr_file, 'r')
+                except Exception:
+                    h5f.close()
+                    print('Problem with file: ', clvr_file)
+                    continue
+                if last_h5f is not None:
+                    last_h5f.close()
+                last_h5f = h5f
                 last_clvr_file = clvr_file
             else:
-                if clvr_file == last_clvr_file:
-                    hf5 = last_h5f
-                else:
-                    last_h5f.close()
-                    try:
-                        h5f = h5py.File(clvr_file, 'r')
-                    except Exception:
-                        h5f.close()
-                        print('Problem with file: ', clvr_file)
-                        continue
-                    last_h5f = hf5
+                h5f = last_h5f
 
             gvals = get_grid_values(h5f, 'temp_11_0um_nom', ll[0], cc[0], 20)