diff --git a/video_prediction_tools/data_preprocess/preprocess_data_step2.py b/video_prediction_tools/data_preprocess/preprocess_data_step2.py
index a062ee1cefc0b0683f59a4d86736a4500243761e..a197471b22f28cc1c3bae9fe29bd7279d2015cde 100644
--- a/video_prediction_tools/data_preprocess/preprocess_data_step2.py
+++ b/video_prediction_tools/data_preprocess/preprocess_data_step2.py
@@ -218,7 +218,8 @@ class ERA5Pkl2Tfrecords(ERA5Dataset):
             X_end = X_start + self.sequence_length
             seq = X_train[X_start:X_end, ...]
             # recording the start point of the timestamps (already datetime-objects)
-            t_start = ERA5Pkl2Tfrecords.ensure_datetime(T_train[X_start][0])
+           
+            t_start = ERA5Pkl2Tfrecords.ensure_datetime(T_train[X_start])
             seq = list(np.array(seq).reshape((self.sequence_length, self.height, self.width, self.nvars)))
             if not sequences:
                 last_start_sequence_iter = sequence_iter