better threshold check