Only updates dom when attribute is changed