Add key check after regenerate.