Add destroy method and fixed bug in addChildren