fix permissions on directories