adding a socket-closed-p check to send-response