fix permissions setting