fix DOM parsing