diff --git a/src/DataVampire.cpp b/src/DataVampire.cpp
index efad3411ff7b83b13bbd90c8ed1888c17af5892a..b33ef9795982395ca00ca162ecf8a789020ad71a 100644
--- a/src/DataVampire.cpp
+++ b/src/DataVampire.cpp
@@ -1384,9 +1384,8 @@ Tango::DevVarDoubleArray *DataVampire::get_sum(const Tango::DevVarLongArray *arg
 	
 		// check and extract input parameters
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);	
-	
 		// if data not preset get data and store it into circular buffers
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		// get start idx of the circular buffer
 		int32_t start_idx = get_start_index(mode, num_samples, bn_start, bn_end);	
@@ -1444,7 +1443,7 @@ Tango::DevVarDoubleArray *DataVampire::get_mean(const Tango::DevVarLongArray *ar
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);
 		
 		// if data not preset get data and store it into circular buffers	
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		
 		// get start idx of the circular buffer
@@ -1504,7 +1503,7 @@ Tango::DevVarDoubleArray *DataVampire::get_hor_pos(const Tango::DevVarLongArray
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);
 		
 		// if data not preset get data and store it into circular buffers	
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		
 		// get start idx of the circular buffer
@@ -1564,7 +1563,7 @@ Tango::DevVarDoubleArray *DataVampire::get_ver_pos(const Tango::DevVarLongArray
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);
 		
 		// if data not preset get data and store it into circular buffers	
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		
 		// get start idx of the circular buffer
@@ -1624,7 +1623,7 @@ Tango::DevVarDoubleArray *DataVampire::get_hor_pos_std(const Tango::DevVarLongAr
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);
 		
 		// if data not preset get data and store it into circular buffers	
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		
 		// get start idx of the circular buffer
@@ -1684,7 +1683,7 @@ Tango::DevVarDoubleArray *DataVampire::get_ver_pos_std(const Tango::DevVarLongAr
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);
 		
 		// if data not preset get data and store it into circular buffers	
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		
 		// get start idx of the circular buffer
@@ -1744,7 +1743,7 @@ Tango::DevVarDoubleArray *DataVampire::get_valid_values(const Tango::DevVarLongA
 		get_param_in(argin, &mode, &num_samples, &bn_start, &bn_end);
 		
 		// if data not preset get data and store it into circular buffers	
-		if (bn_end > last_bn)
+		if ((bn_end > last_bn) || (mode == 0))
 			store_circ_data(mode, num_samples, last_bn+1, bn_end);	
 		
 		// get start idx of the circular buffer
@@ -2818,10 +2817,6 @@ void DataVampire::store_circ_data(int32_t mode, int32_t num_samples, int32_t bn_
 		}	
 	}	
 
-	/*for (int i = 0; i < cmd_input_value.size(); i++) {
-		printf("in %d %f\n",i, cmd_input_value[i]);
-	}*/
-
 	try {
 		// prepare input
 		Tango::DeviceData Din = cmd_insert_values(cmd_in_type, cmd_input_value, cmd_input_value_str);
diff --git a/src/acqthread.cpp b/src/acqthread.cpp
index dd2618dc40494b576727f0a36a69a02257c9d493..98e7637b3463a527865f7bfc745b53b21498546f 100644
--- a/src/acqthread.cpp
+++ b/src/acqthread.cpp
@@ -13,7 +13,7 @@
  */		
 void *acqthread::run_undetached(void *) 
 {
-	int margin = 2;
+	int margin = 3;
 	double frequency = 50;
 	int32_t old_bn = 0;
 	Tango::DevLong bunch_number;