Changed hasAttribute function