do not crash on closed sockets