Added isGenerated check.