optimize threshold issue