I would of said ECU like the mechanic. but the other suggestions are possibilities. When you take the battery cable off, that resets the ECU which in turn erases ECU memory. So unless you leaving something out, then I would personally point to the ECU. But I am no Mechanic.