fix a bug for recovery