fixed bugs with adding groups