removed InputStream.close(); we should not be closing the stream here