I t could be several different possibilities, with all of the sensors on vehicles these days, but if i had to guess with the little amount of information you provided , i would have to say it could possibly be a vacuum line myabe cracked or an idle control valve gone bad. If you can provide some more information about the symptoms maybe i could come up with more, but since it was wrecked it might end up being a nightmare to find the problem. GOOD LUCK !!!