added check for </stream> in connect_cb_wrapper