missed an  variable to correctly calculate button groups, fixes #1637