fixing invalid dom