it would really be nice to use our DOM library here. maybe I'll open a separate PR to fix.