converted to umd so it can work in amd/cjs/global