fix close connection && fix sleep in chan