fixed line ending bug in peek()