fix key creation