String ends at space instead of at newline