bug fix and refactor readMultiLine