add support for label attribute (closes #335)