reworked the append extra fields function