fix key processing bug introduced by codex re-structuring