fix for XML serialization TypeError exception