Added polyfill for iOS6 devices