The synergetic effects of drift kinetic resonances, the resistive layer dissipation, the magnetic feedback, and the toroidal plasma flow on the stability of the resistive wall mode are numerically investigated using a full toroidal resistive magnetohydrodynamic-kinetic hybrid stability code MARS-K (Liu Y Q et al 2008 Phys. Plasmas 15 112503). It is found that the plasma resistivity, coupled with the favourable average curvature effect, can enlarge the stable domain predicted by the drift kinetic model. A synergy between the precessional drift resonance damping, the magnetic feedback and the plasma flow helps open two stability windows. The width of the inner stability window increases with the feedback gain, but decreases with the flow speed. In addition, optimization of the toroidal phase difference of the feedback gains between the upper and lower active coils can lead to a full suppression of the mode.