fix bug when reloading the plugin: disconnect signals before unload