handle case when options.domElement is null