On the stabilizing effects of magnetic field on the boundary layer