fix support for nodejs (but breaks browser)