proper deactivation of plugins in non-gui versions