This sounds like the accelerator pedal position sensor is malfunctioning. I do not remember the code number off hand, but did you check your code when it was showing the check engine light?