A stochastic cellular automaton (CA) model is presented to study traffic flow in cities. In order to avoid traffic jam, cars are allowed to turn with probability p(turn) when cars are blocked ahead by other cars. It is found that the jam-avoiding turn has an important effect on traffic jam. With increasing car density, jamming transitions occur from a maximal velocity phase, through a homogeneously moving phase, to a jamming phase, with a critical point. Above the critical point, the jamming transition does not appear. It is shown that allowing cars to turn results in a complex phase diagram.