bugs correction

bugs correction
added anomaly detection script