Added support for dynamically assigning roles as they are selected in the dropdowns.