change dispatcher to just take an agent