added polyfill and dirty code