closing webSocket connection in case of failed registration