handle detached heads