titleCase function is working correctly