Switched to constructor and polyfill approach
Fixed typo