polyfill to support Safari 6