fix when document.register() supported natively