diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h
index 1de162d00c2aedbb49b9e8edef154fddd4e3f08c..12e994d3993773bc19f67338ddb8677ea2c59c9f 100755
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h
@@ -181,6 +181,7 @@ class PixelMainMon : public ManagedMonitorToolBase {
 
   const PixelID* m_pixelid;
   uint64_t m_event;
+  uint64_t m_event5min;
 
   time_t m_startTime;
   bool m_majorityDisabled;  // check for each event, true if >50% modules disabled
@@ -196,8 +197,8 @@ class PixelMainMon : public ManagedMonitorToolBase {
   int m_nGood_mod[PixLayerIBL2D3DDBM::COUNT];
   int m_nActive_mod[PixLayerIBL2D3DDBM::COUNT];
 
-  unsigned int m_nRefresh;
-  unsigned int m_nRefresh5min;
+  int m_nRefresh;
+  int m_nRefresh5min;
 
   const AtlasDetectorID* m_idHelper;
 
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx
index f806c4a6cf52d1e5e5bb437f0ef2e040e14f625a..607534d1a828f0b03bf7591a3a8dfe6c4bd41ceb 100644
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/HelperFunctions.cxx
@@ -206,7 +206,7 @@ void PixelMainMon::formatPP0Histos(TProfile_LW* D_A, TProfile_LW* D_C, TProfile_
 }
 
 void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A, TProfile_LW* D_C, TProfile_LW* B0, TProfile_LW* B1, TProfile_LW* B2, TProfile_LW* IBL_A, TProfile_LW* IBL_C) {
-  if (!(D_A && D_C && B0 && B1 && B2 && occupancy && m_status && m_event)) return;
+  if (!(D_A && D_C && B0 && B1 && B2 && occupancy && m_status && m_event5min)) return;
   unsigned int nbinx;
   unsigned int nbiny;
   // use FE occ for IBL, mod occ for the rest
@@ -216,7 +216,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A,
     nbiny = occupancy->IBL->GetNbinsY();
     for (unsigned int x = 1; x <= nbinx; ++x) {
       for (unsigned int y = 1; y <= nbiny; ++y) {
-        const auto content = occupancy->IBL->GetBinContent(x, y) / (1.0 * m_event);
+        const auto content = occupancy->IBL->GetBinContent(x, y) / (1.0 * m_event5min);
 	if (m_status->IBL->GetBinContent(x, y)!=2) {
 	  if (x>0.5*nbinx) IBL_A->Fill(y, content);
 	  else IBL_C->Fill(y, content);
@@ -228,7 +228,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A,
   nbiny = occupancy->B0->GetNbinsY();
   for (unsigned int x = 1; x <= nbinx; ++x) {
     for (unsigned int y = 1; y <= nbiny; ++y) {
-      const auto content = occupancy->B0->GetBinContent(x, y) / (1.0 * m_event);
+      const auto content = occupancy->B0->GetBinContent(x, y) / (1.0 * m_event5min);
       if (m_status->B0->GetBinContent(x, y)!=2) {
 	B0->Fill(y, content);
       }
@@ -238,7 +238,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A,
   nbiny = occupancy->B1->GetNbinsY();
   for (unsigned int x = 1; x <= nbinx; ++x) {
     for (unsigned int y = 1; y <= nbiny; ++y) {
-      const auto content = occupancy->B1->GetBinContent(x, y) / (1.0 * m_event);
+      const auto content = occupancy->B1->GetBinContent(x, y) / (1.0 * m_event5min);
       if (m_status->B1->GetBinContent(x, y)!=2) {
 	B1->Fill(y, content);
       }
@@ -248,7 +248,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A,
   nbiny = occupancy->B2->GetNbinsY();
   for (unsigned int x = 1; x <= nbinx; ++x) {
     for (unsigned int y = 1; y <= nbiny; ++y) {
-      const auto content = occupancy->B2->GetBinContent(x, y) / (1.0 * m_event);
+      const auto content = occupancy->B2->GetBinContent(x, y) / (1.0 * m_event5min);
       if (m_status->B2->GetBinContent(x, y)!=2) {
 	B2->Fill(y, content);
       }
@@ -258,7 +258,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A,
   nbiny = occupancy->A->GetNbinsY();
   for (unsigned int x = 1; x <= nbinx; ++x) {
     for (unsigned int y = 1; y <= nbiny; ++y) {
-      const auto content = occupancy->A->GetBinContent(x, y) / (1.0 * m_event);
+      const auto content = occupancy->A->GetBinContent(x, y) / (1.0 * m_event5min);
       if (m_status->A->GetBinContent(x, y)!=2) {
 	D_A->Fill( (x-1)*8 + (y-1)/6 + 1, content);
       }
@@ -268,7 +268,7 @@ void PixelMainMon::fillPP0Histos(PixelMon2DMapsLW* occupancy, TProfile_LW* D_A,
   nbiny = occupancy->C->GetNbinsY();
   for (unsigned int x = 1; x <= nbinx; ++x) {
     for (unsigned int y = 1; y <= nbiny; ++y) {
-      const auto content = occupancy->C->GetBinContent(x, y) / (1.0 * m_event);
+      const auto content = occupancy->C->GetBinContent(x, y) / (1.0 * m_event5min);
       if (m_status->C->GetBinContent(x, y)!=2) {
 	D_C->Fill( (x-1)*8 + (y-1)/6 + 1, content);
       }
diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx
index f3c49d28fa188003fa2d48315eb2fa93020fefea..7482d602487a6488208ee098bd8f33cfaa85db42 100755
--- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx
+++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx
@@ -123,6 +123,7 @@ PixelMainMon::PixelMainMon(const std::string& type, const std::string& name, con
   memset(m_nActive_mod, 0, sizeof(m_nActive_mod));
   m_pixelid = 0;
   m_event = 0;
+  m_event5min = 0;
   m_startTime = 0;
   m_majorityDisabled = 0;
   m_lumiBlockNum = 0;
@@ -710,10 +711,12 @@ StatusCode PixelMainMon::fillHistograms() {
   if(!(thisEventInfo.isValid())) {
     if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "No EventInfo object found" << endmsg;
   } else {
+
     m_currentTime = thisEventInfo->timeStamp();
     m_currentBCID = thisEventInfo->bcid();
-    unsigned int currentdiff = (m_currentTime - m_firstBookTime) / 100;
-    unsigned int currentdiff5min = (m_currentTime - m_firstBookTime) / 300;
+    int currentdiff = (int)(m_currentTime - m_firstBookTime) / 100;
+    int currentdiff5min = (int)(m_currentTime - m_firstBookTime) / 300;
+
     // for 100 sec
     if (currentdiff > m_nRefresh) {
       m_doRefresh = true;
@@ -725,8 +728,10 @@ StatusCode PixelMainMon::fillHistograms() {
     if (currentdiff5min > m_nRefresh5min) {
       m_doRefresh5min = true;
       m_nRefresh5min = currentdiff5min;
+      m_event5min = 1;
     } else {
       m_doRefresh5min = false;
+      m_event5min++;
     }
   }