Fix rekey in some case