Attempts to fix mix-up of messages sent from the server, by specifically passing userToken, socketClient and data as parameters, and not letting use it from the top level function