if grant to sg then append grant.groupId instead grant.name

Fix for issue #4