How can this be prevented?

It cant unless you say what needs to be prevented