changes stdin reading to stop at newline