diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp
index 55484ac9fe4f6bcf2d6274c40f9396823e147e70..04ebefd2a63173df123119cff47a3f31724a4c1a 100644
--- a/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp
+++ b/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp
@@ -31,6 +31,9 @@ namespace rfiStrategy {
 	void StatisticalFlagAction::Perform(ArtifactSet &artifacts, class ProgressListener &)
 	{
 		TimeFrequencyData &data = artifacts.ContaminatedData();
+		if(data.MaskCount() > 1)
+			throw std::runtime_error("Error: the statistical flag action (dilation operation) can only be applied on data with a single mask. Therefore, it should be placed 'under' a Set all polarization equal-operation, or inside a For each polarization action.");
+			
 		Mask2DPtr mask = Mask2D::CreateCopy(data.GetSingleMask());
 		
 		StatisticalFlagger::EnlargeFlags(mask, _enlargeTimeSize, _enlargeFrequencySize);