better handling for detached head