bug: cannot call childView.destroy() on an undefined childView - check if childView exists before calling destroy