adding groups where required