Added clearing all subs for an agent for terminate and clear