Finally figured out auto registration of agents