bugfix: close socket when link down