fix threshold issue