diff --git a/cal_tools/cal_tools/agipdlib.py b/cal_tools/cal_tools/agipdlib.py
index 47198bc147d9c635f91742aee713981551aa8fd5..45dcac7782e9135183900e85ba03303df497a274 100644
--- a/cal_tools/cal_tools/agipdlib.py
+++ b/cal_tools/cal_tools/agipdlib.py
@@ -1050,7 +1050,7 @@ class AgipdCorrections:
             if self.max_pulse == 0:
                 self.hist_pulses = int(self.max_pulse + 1)
             else:
-                self.hist_pulses = self.max_pulse
+                self.hist_pulses = int(self.max_pulse)
 
             bins = (self.bins_signal_low_range, self.hist_pulses)
             rnge = [[-50, 1000], [self.min_pulse,