fixed unloading of plugins