added chunked input/output ..something fishy