fix directory and file permissions
Merge branch 'fix_permissions' into merged