added conditional for groupdata

added conditional for groupdata