I'm proving the following lemma (this is part of a proof of Hurewicz's theorem)
Lemma. Let $n\geq1$. For $n> 1$ assume known that $\pi_{n−1}(S^{ n−1}, z)$ is free abelian of rank $1$. Let $f$ be a continuous self map of $(D^n,\partial D^n)$ of degree $\pm1$. Then $f$ is pair-homotopic to the identity if $\deg(f) = 1$
At one point of the proof, we proved the existence of an homotopy $H:S^{n-1}\times I\rightarrow S^{n-1}$ between $f|_{S^{n-1}}$ and the identity $\text{id}$ of $S^{n-1}$. Then, the professor says that
[The homotopy $H$] induces a map $D^n\times\{0\}\cup S^{n-1}\times I\cup D^n\times\{1\}\xrightarrow{f|_{S^{n-1}}\cup H\cup\text{id}}D^n$. Since $D^n\times I$ can be obtained from $D^n\times\{0\}\cup S^{n-1}\times I\cup D^n\times\{1\}$ by attaching an $(n + 1)$-cell and $D^n$ is contractible, there is a continuous extension $\bar H: D^n \times I\rightarrow D^n$
I don't understand why we need $D^n$ to be contractable. Moreover, I would say that the homotopy $\bar H$ can be described explicitly: First, $D^n\times\{0\}\cup S^{n-1}\times I$ is a retraction of $D^n\times I$, so take $$p:D^n\times I\rightarrow D^n\times\{0\}\cup S^{n-1}\times I$$ identity on the subspace, then $$\tilde H:D^n\times I\xrightarrow{p}D^n\times\{0\}\cup S^{n-1}\times I\xrightarrow{f|_{S^{n-1}}\cup H}S^n\hookrightarrow D^n$$is an homotopy between $f$ and a map $g:D^n\rightarrow D^n$ which is the identity on $S^{n-1}$. Then consider the map $$\hat H:D^n\times I\rightarrow D^n,\qquad\hat H(v,t)=g(v)(1-t)+vt$$Then $\hat H$ is a pair-homotopy between $g$ and the identity of $D^n$, hence we can juxtapose $\tilde H,\hat H$ to get a pair-homotopy between $f$ and the identity.
Is there something wrong with my argument? Any feedback is appreciated.