Fix function to show warning when deactivate plugin