Let $M$ be a compact submanifold with boundary of $\mathbb{R}^n$ of dimension $n$. Let $f:M \to \mathbb{R}$ be a Morse function. Then $f$ is proper. Let $N:=M-bd(M)$. How can I get a proper Morse function $g: N\to \mathbb{R}$ such that index of critical points of $f$ and $g$ agrees?