This was an oversight in 6594e802ab. First it must check if the attribute exists before adding it.
6594e802ab