Fix key errors in retry process