fixed disconnect of agency connections, use less CPU while spinning in agency methods