fixed fix_permissions again