Determining the weak phase γ in the presence of rescattering