fixed error where empty groupings were chosen as a prompt