fix: use event page to free memory when the extension is not needed