added possibility for plugins to cleanup