why do you send attributeSet.getSelectedAttribute()? I mean the first parameter (attributeSet) already contains this. Would it work if you just pass the actual attribute and not the set?