made setting of threshold working