Fixed bug where closing the tab would break the extension.