added correct finishing of reader and connection closing, increased buffer size