fixing detached head