deal with detached head