Made output table compatible with grouping

Added validation for grouping column names