Add support for closing WS connection