checking whether the data attribute is defined