fixed threshold agent, now works perfectly.