Rough idle on 2003 Hyundai Elantra

We replaced the head which has good comprasion. replaced the radiator, cam shaft sensor, ecm, and the fuel regulator the timing belt which everything shows in time lined up and all good. As well as an oil change and tune up. But the car still idles rough and once it has been on for a few minutes and you apply gas to it it stalls.

Asked by for the 2003 Hyundai Elantra
I never like to replace parts unless they are proven to be defective. Is the Check Engine/Service Engine Soon light on if so a professional grade scan tool needs to be used to retrieve trouble codes stored in the computer in your car but more important to look at live engine sensor data to see where the problem lies. Its hard to guess without being able to do basic diagnostic tests. Recheck the cam timing make sure it is correct. Hyundai as a car manufacturer put a lot of free technical information and workshop manuals on line for Hyundai owners. Check out lots of great information.
Thanks, the light isn't on but tried of the guessing game taking it to dealership tomorrow to have a scan done. Thanks again.