added "round()" for average value to fix wrong triggering