reworked the hook to deinit SMB