better polyfill for older browsers