fix removed nodes and support svg elements