better input stream handling with error caret