Considering the evolution of a perfect fluid with self-similarity of the second kind, we have found that an initial naked singularity can be trapped by an event horizon due to collapsing matter. The fluid moves along time-like geodesics with a self-similar parameter $alpha = -3$. Since the metric obtained is not asymptotically flat, we match the spacetime of the fluid with a Schwarzschild spacetime. All the energy conditions are fulfilled until the naked singularity.