shutdown_plugin hook to releasing resources resolves #165