Add a global class modification guard.