I had this same exact problem. For me it turned out to be a torn vacuum hose that leads from the intake manifold to the MAP sensor. Check those lines and make sure to replace any torn hose. This fixed the issue for me. If not, then try to get a OBD2 scanner and plug it in when you get a check engine light, the codes can point you in the right direction. Hope this helps.