replaceAll is not a function JavaScript Error