moved setting of permissions to fix bug when upgrading