Limit Function Scope
Fined a Possible BUG

* check whether stream already closing before start reading in connect
callback