fixing undeployment issue and nested group handling