fix closing the children