fix key permissions