Inverse of a sum of matrices using SVD

Given $$A^TA = U\Sigma U^T \,\,\,\text{(SVD)}$$ Where, by definition of SVD, $U$ is an orthogonal matrix and $\Sigma$ is a diagonal matrix. Suppose I want to compute $$(A^TA + \gamma D)^{-1}$$ Where $D$ is a rank deficient diagonal matrix. I read a paper whose authors claim that the inverse can be computed as: $$U(\Sigma + \gamma D)^{-1}U^T$$

I can't seem to make the jump from the first two statements to the third. Can anyone provide any pointers as to what I might be missing? I've tried verifying this through Matlab and it doesn't seem to work as they claim.

$$(U \Sigma U^T + \gamma D)^{-1} = (U (\Sigma + \gamma U^T D U) U^T)^{-1} = U (\Sigma + \gamma U^T D U)^{-1} U^T$$
Unless $D$ happens to commute with $U$, you can't change the $U^T D U$ to $D$.