account for when $gid returns no existing directive match #3382
move new logic to new update hook #3382
fix indents #3382
Merge pull request #3837 from openscholar/3382-hotfix1

account for when $gid returns no existing directive match #3382