fix potential crash when unregistering a plugin
remove unused include