updated lib
updated check_thresholds call