debug code from head_object()