update sample code for polyfill