set threshold from GUI