We study the center of mass movement of a cold two-level atom crossing through an electromagnetic cavity. This cavity contains both a quantized field mode and a set of A fixed two-level atoms resonant with the field. We find that, even in the absence of fixed atoms, the atomic coherence allows us to switch the interaction from an exclusive barrier potential to an attractive potential. In such a way that the initial atomic phase behaves as a quantum switch. The set of fixed atoms, initially prepared in semiclassical eigenstate, gives origin to an effective growing of the coupling constant of the moving atom and the field, allowing an important increase of the threshold value of kinetic energy of moving atom where a total reflection can be experimentally observed.