Demand when u(x,y,z)=(x+y)z

Problem. Find demand for this utility function: u(x,y,z)=(x+y)z
Here we need to solve the following consumer’s problem:
\displaystyle\max_{x,y,z} \ (x+y)z \\ \text{s.t. } p_Xx+p_Yy+p_Zz\leq M \\ \text{and } x\geq 0, \ y\geq 0, \ z\geq 0
where p_X> 0, \ p_Y > 0, \ p_Z > 0, \ M\geq 0 are given.
Solution. Solving this problem, we get the demand as:
(x^d,y^d,z^d)\in\begin{cases}\left\{\left(\dfrac{M}{2p_X},0,\dfrac{M}{2p_Z}\right)\right\} & \text{if } p_X<p_Y \\ \left\{\left(0,\dfrac{M}{2p_Y},\dfrac{M}{2p_Z}\right)\right\} & \text{if } p_X>p_Y \\ \left\{\left(x,y,\dfrac{M}{2p_Z}\right)\in\mathbb{R}^3_+|x+y=\dfrac{M}{2p_X}\right\} & \text{if } p_X=p_Y \end{cases}
Indirect utility function is V(p_X,p_Y,p_Z,M)=\dfrac{M^2}{4p_Z\min(p_X,p_Y)}