fix for last closure library, isDocumentMode is deprecated now