fix new line handling