Added endsWith polyfill