added sorting of agent groups