Added polyfill for ECMAScript 5