Fix bug with detached method and propagate detaching to the children