Fix checking for element in nodeList