fix bug which causes newlines to dissapear