And how to prevent it for good.