try to fix socket closed issue.