Fix the extension shutdown