null handling code for groups and plans