Heater works while accelerating, blows cold when release gas

It sounds like there is a problem with the cabin temperature. Possibly the blend door is out of whack due to a vacuum leak that is causing the door to open or close at the wrong time.