Application restrectured. Issue with socket wss when user exits the webpage