handle multiple spaces