Hello all. So last summer the 2001 X5 3.0 would , with the car in park ,AC on max (waiting for kids to get out of school, 15 minutes or so) would seem fine and normal. As soon as I put it in drive , gave it some gas it bogged down to almost killing the engine. This happened late last summer and it was only about 3 times. Then fall and winter came no need for AC so there were no issuses. 2 weeks ago engine lite came on, went to autozone got P0171 and P0174 codes. I pulled a moth out of mass air flow sensor and engine lite went off. Today was warm 85 here so I had the ac on max waiting for kids to get out, 10 minute wait. (first time since last summer running ac) Heading back home got about 5 miles stopped at a lite, lite turned green gave it sum gas and started bogging down , engine died. Put it in nuetral cranked it ,pulled over, turned off AC and made it home (with no AC) Also I'll add that I believe the FSU has gone bad because the air blows erratically. (this started last winter) So I bought a new one this morning. Could the MAF or FSU be causing this bogging issue? The car doesnt seem to have this issue unless its sitting in park for awhile. We drove 3 1/2 hours to the beach with AC on MAX with no issues late last summer. Again it seems to only happen after the car is sitting for awhile. How should I troubleshoot this issue? Its Spring and I need me some AC

And thanks ahead of time.