properly close the InputStream(Reader)