Question about solving absolute value equation.

What is the sum of all possible solutions to this equations?

$|x+4|^2 -10|x+4|=24$

My attempt:

Since $(x+4)^2=|x+4|^2$, so I can ignore the absolute sign of the first term. So we only need to deal with the absolute sign of the second term. This become two cases:

1) $(x+4)^2-10(x+4)=24$

2) $(x+4)^2+10(x+4)=24$

But it turns out my answer is wrong. I am not sure where I did wrong. The correct way is to do a substitution that $u=|x+4|$, then it would become $u^2-10u=24$. But where did I do wrong? I didn't see it.

The first equation above is only valid when $x+4 \ge 0$, and we must disregard any solution that doesn't lie in this range, and similarly for the second equation and $x+4 < 0$.
$(1): (x - 1)^2 = 7^2 \iff x = 8 \text{ or } x = -6$, of which only the first solution is valid, and
$(2): (x + 9)^2 = 7^2 \iff x = -2 \text{ or } x = -16$, and only the second solution is valid.
Note that something similar happens for the equation in $u$. The solutions are $u = -2$ or $u = 12$, and the first case cannot happen because an absolute value cannot be negative. This gives you the same roots.