fix DOM traversal