threshold needs to be dynamic too