enhanced dynamic "adder" method to conditionally replace if the entity already exists in the array.