if that doesn't solve the problem look for check engine codes. My truck was doing this a week ago and it turned out my Mass Airflow Sensor was dead