listen for socket close