added event handlers to load principal and group