Fixing Unique Key for template and accepting update for template