fix 500 on creating groups

fixes bug introduced by commit d9697c29