Anomaly detector: added a threshold property