added replaceSpaces