a little more info on the setup, etc would help.

iacv code could be the reason it's not idling properly since it controls idle and low throttle airflow. there could be other reasons for the poor idle like vac leaks, timing jumped, etc.