Adding support for detached heads