Tweak the way the extension is attached to avoid race conditions