regenerate id and key