fix for nil attribute handling -- thanks fancyremarker!