remove websocket if it is closed