proper dom cleanup