Stabilization of the resistive shell mode in tokamaks