Updated with compat polyfills