cleanup dom writer