adding attributeChanged listener