fix the bug when add threshold