Fixed the regeneration error