changed to global regex to replace all spaces