Fix for issue #12, detaching only every other child 

due to array/list modification during iteration over the list/array