Added DOM cleanup code