2006 Ford Fusion

When I drive in stop & go traffic for a short period of time, my car refuses to accelerate, when I stop for a short time and restart the engine it works ok if the traffic is moving normally. This could cause an accident and I would like to fix it