fixed polyfill for String.toTitleCase