fixed exception on server shutdown
added PluginFlag