Fixed bug with not closing websocket session