When I had a bad o2 sensor, my car did this. Just a thought