added check for tablepergroup