improved attribute handling