Corrected white space handling

It now correctly handles spaces